@Internal public final class DynamicSourceUtils extends Object
DynamicTableSource
.Modifier and Type | Method and Description |
---|---|
static org.apache.calcite.rel.RelNode |
convertDataStreamToRel(boolean isStreamingMode,
ReadableConfig config,
org.apache.flink.table.planner.calcite.FlinkRelBuilder relBuilder,
ObjectIdentifier identifier,
ResolvedSchema schema,
DataStream<?> dataStream,
DataType physicalDataType,
boolean isTopLevelRecord,
ChangelogMode changelogMode)
Converts a given
DataStream to a RelNode . |
static org.apache.calcite.rel.RelNode |
convertSourceToRel(boolean isStreamingMode,
ReadableConfig config,
org.apache.flink.table.planner.calcite.FlinkRelBuilder relBuilder,
ObjectIdentifier identifier,
ResolvedCatalogTable catalogTable,
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<String> |
createRequiredMetadataKeys(ResolvedSchema schema,
DynamicTableSource source)
Returns a list of required metadata keys.
|
static boolean |
isSourceChangeEventsDuplicate(ResolvedCatalogTable catalogTable,
DynamicTableSource tableSource,
TableConfig config)
Returns true if the table source produces duplicate change events.
|
static boolean |
isUpsertSource(ResolvedCatalogTable catalogTable,
DynamicTableSource tableSource)
Returns true if the table is an upsert source.
|
static void |
prepareDynamicSource(ObjectIdentifier sourceIdentifier,
ResolvedCatalogTable table,
DynamicTableSource source,
boolean isStreamingMode,
ReadableConfig config)
Prepares the given
DynamicTableSource . |
public static org.apache.calcite.rel.RelNode convertDataStreamToRel(boolean isStreamingMode, ReadableConfig config, org.apache.flink.table.planner.calcite.FlinkRelBuilder relBuilder, ObjectIdentifier identifier, ResolvedSchema schema, 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 isStreamingMode, ReadableConfig config, org.apache.flink.table.planner.calcite.FlinkRelBuilder relBuilder, ObjectIdentifier identifier, ResolvedCatalogTable catalogTable, 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(ObjectIdentifier sourceIdentifier, ResolvedCatalogTable table, DynamicTableSource source, boolean isStreamingMode, ReadableConfig config)
DynamicTableSource
. It check whether the source is compatible with
the given schema and applies initial parameters.public static List<String> createRequiredMetadataKeys(ResolvedSchema schema, DynamicTableSource source)
SupportsReadingMetadata.listReadableMetadata()
.
This method assumes that source and schema have been validated via prepareDynamicSource(ObjectIdentifier, 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(ResolvedCatalogTable catalogTable, DynamicTableSource tableSource)
public static boolean isSourceChangeEventsDuplicate(ResolvedCatalogTable catalogTable, DynamicTableSource tableSource, TableConfig config)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.