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