@Internal public final class DynamicSourceUtils extends Object
DynamicTableSource.| Modifier and Type | Method and Description |
|---|---|
static org.apache.calcite.rel.RelNode |
convertDataStreamToRel(boolean isBatchMode,
org.apache.flink.configuration.ReadableConfig config,
FlinkRelBuilder relBuilder,
org.apache.flink.table.catalog.ContextResolvedTable contextResolvedTable,
org.apache.flink.streaming.api.datastream.DataStream<?> dataStream,
org.apache.flink.table.types.DataType physicalDataType,
boolean isTopLevelRecord,
org.apache.flink.table.connector.ChangelogMode changelogMode)
Converts a given
DataStream to a RelNode. |
static org.apache.calcite.rel.RelNode |
convertSourceToRel(boolean isBatchMode,
org.apache.flink.configuration.ReadableConfig config,
FlinkRelBuilder relBuilder,
org.apache.flink.table.catalog.ContextResolvedTable contextResolvedTable,
org.apache.flink.table.planner.plan.stats.FlinkStatistic statistic,
List<org.apache.calcite.rel.hint.RelHint> hints,
org.apache.flink.table.connector.source.DynamicTableSource tableSource)
Converts a given
DynamicTableSource to a RelNode. |
static org.apache.flink.table.types.logical.RowType |
createProducedType(org.apache.flink.table.catalog.ResolvedSchema schema,
org.apache.flink.table.connector.source.DynamicTableSource source)
Returns the
DataType that a source should produce as the input into the runtime. |
static List<org.apache.flink.table.catalog.Column.MetadataColumn> |
createRequiredMetadataColumns(org.apache.flink.table.catalog.ResolvedSchema schema,
org.apache.flink.table.connector.source.DynamicTableSource source)
Returns a list of required metadata columns.
|
static List<org.apache.flink.table.catalog.Column.MetadataColumn> |
extractMetadataColumns(org.apache.flink.table.catalog.ResolvedSchema schema) |
static boolean |
isSourceChangeEventsDuplicate(org.apache.flink.table.catalog.ResolvedSchema resolvedSchema,
org.apache.flink.table.connector.source.DynamicTableSource tableSource,
org.apache.flink.table.api.TableConfig tableConfig)
Returns true if the table source produces duplicate change events.
|
static boolean |
isUpsertSource(org.apache.flink.table.catalog.ResolvedSchema resolvedSchema,
org.apache.flink.table.connector.source.DynamicTableSource tableSource)
Returns true if the table is an upsert source.
|
static void |
prepareDynamicSource(String tableDebugName,
org.apache.flink.table.catalog.ResolvedCatalogTable table,
org.apache.flink.table.connector.source.DynamicTableSource source,
boolean isBatchMode,
org.apache.flink.configuration.ReadableConfig config)
Prepares the given
DynamicTableSource. |
public static org.apache.calcite.rel.RelNode convertDataStreamToRel(boolean isBatchMode,
org.apache.flink.configuration.ReadableConfig config,
FlinkRelBuilder relBuilder,
org.apache.flink.table.catalog.ContextResolvedTable contextResolvedTable,
org.apache.flink.streaming.api.datastream.DataStream<?> dataStream,
org.apache.flink.table.types.DataType physicalDataType,
boolean isTopLevelRecord,
org.apache.flink.table.connector.ChangelogMode changelogMode)
DataStream to a RelNode. It adds helper projections if
necessary.public static org.apache.calcite.rel.RelNode convertSourceToRel(boolean isBatchMode,
org.apache.flink.configuration.ReadableConfig config,
FlinkRelBuilder relBuilder,
org.apache.flink.table.catalog.ContextResolvedTable contextResolvedTable,
org.apache.flink.table.planner.plan.stats.FlinkStatistic statistic,
List<org.apache.calcite.rel.hint.RelHint> hints,
org.apache.flink.table.connector.source.DynamicTableSource tableSource)
DynamicTableSource to a RelNode. It adds helper projections
if necessary.public static void prepareDynamicSource(String tableDebugName, org.apache.flink.table.catalog.ResolvedCatalogTable table, org.apache.flink.table.connector.source.DynamicTableSource source, boolean isBatchMode, org.apache.flink.configuration.ReadableConfig config)
DynamicTableSource. It check whether the source is compatible with
the given schema and applies initial parameters.public static List<org.apache.flink.table.catalog.Column.MetadataColumn> createRequiredMetadataColumns(org.apache.flink.table.catalog.ResolvedSchema schema, org.apache.flink.table.connector.source.DynamicTableSource source)
SupportsReadingMetadata.listReadableMetadata().
This method assumes that source and schema have been validated via prepareDynamicSource(String, ResolvedCatalogTable, DynamicTableSource, boolean,
ReadableConfig).
public static org.apache.flink.table.types.logical.RowType createProducedType(org.apache.flink.table.catalog.ResolvedSchema schema,
org.apache.flink.table.connector.source.DynamicTableSource source)
DataType that a source should produce as the input into the runtime.
The format looks as follows: PHYSICAL COLUMNS + METADATA COLUMNS
Physical columns use the table schema's name. Metadata column use the metadata key as name.
public static boolean isUpsertSource(org.apache.flink.table.catalog.ResolvedSchema resolvedSchema,
org.apache.flink.table.connector.source.DynamicTableSource tableSource)
public static boolean isSourceChangeEventsDuplicate(org.apache.flink.table.catalog.ResolvedSchema resolvedSchema,
org.apache.flink.table.connector.source.DynamicTableSource tableSource,
org.apache.flink.table.api.TableConfig tableConfig)
public static List<org.apache.flink.table.catalog.Column.MetadataColumn> extractMetadataColumns(org.apache.flink.table.catalog.ResolvedSchema schema)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.