@Internal public final class TypeMappingUtils extends Object
TableSource
and TableSink
.Modifier and Type | Method and Description |
---|---|
static void |
checkPhysicalLogicalTypeCompatible(LogicalType physicalFieldType,
LogicalType logicalFieldType,
String physicalFieldName,
String logicalFieldName,
boolean isSource)
Checks whether the given physical field type and logical field type are compatible at the
edges of the table ecosystem.
|
static int[] |
computePhysicalIndices(List<TableColumn> logicalColumns,
DataType physicalType,
java.util.function.Function<String,String> nameRemapping)
Computes indices of physical fields corresponding to the selected logical fields of a
TableSchema . |
static int[] |
computePhysicalIndicesOrTimeAttributeMarkers(TableSource<?> tableSource,
List<TableColumn> logicalColumns,
boolean streamMarkers,
java.util.function.Function<String,String> nameRemapping)
Computes indices of physical fields corresponding to the selected logical fields of a
TableSchema . |
public static int[] computePhysicalIndices(List<TableColumn> logicalColumns, DataType physicalType, java.util.function.Function<String,String> nameRemapping)
TableSchema
.logicalColumns
- Logical columns that describe the physical type.physicalType
- Physical type to retrieve indices from.nameRemapping
- Additional remapping of a logical to a physical field name.
TimestampExtractor works with logical names, but accesses physical fieldsprojectedLogicalFields
mask.public static int[] computePhysicalIndicesOrTimeAttributeMarkers(TableSource<?> tableSource, List<TableColumn> logicalColumns, boolean streamMarkers, java.util.function.Function<String,String> nameRemapping)
TableSchema
.
It puts markers (idx < 0) for time attributes extracted from DefinedProctimeAttribute
and DefinedRowtimeAttributes
computePhysicalIndices(List, DataType, Function)
should be
preferred. The time attribute markers should not be used anymore.
tableSource
- Used to extract DefinedRowtimeAttributes
, DefinedProctimeAttribute
and TableSource.getProducedDataType()
.logicalColumns
- Logical columns that describe the physical type.streamMarkers
- If true puts stream markers otherwise puts batch markers.nameRemapping
- Additional remapping of a logical to a physical field name.
TimestampExtractor works with logical names, but accesses physical fieldsprojectedLogicalFields
mask.public static void checkPhysicalLogicalTypeCompatible(LogicalType physicalFieldType, LogicalType logicalFieldType, String physicalFieldName, String logicalFieldName, boolean isSource)
TableSource
and TableSink
.physicalFieldType
- physical field typelogicalFieldType
- logical field typephysicalFieldName
- physical field namelogicalFieldName
- logical field nameisSource
- whether it is a source or sink, used for logging.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.