Package org.apache.flink.table.catalog
Class SchemaTranslator
- java.lang.Object
-
- org.apache.flink.table.catalog.SchemaTranslator
-
@Internal public final class SchemaTranslator extends Object
Utility to derive a physicalDataType,Schema, and projections for sinks and sources.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSchemaTranslator.ConsumingResultstatic classSchemaTranslator.ProducingResult
-
Constructor Summary
Constructors Constructor Description SchemaTranslator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SchemaTranslator.ConsumingResultcreateConsumingResult(org.apache.flink.table.catalog.DataTypeFactory dataTypeFactory, org.apache.flink.api.common.typeinfo.TypeInformation<?> inputTypeInfo, org.apache.flink.table.api.Schema declaredSchema)Converts the givenTypeInformationand an optional declaredSchema(possibly incomplete) into the finalSchemaTranslator.ConsumingResult.static SchemaTranslator.ConsumingResultcreateConsumingResult(org.apache.flink.table.catalog.DataTypeFactory dataTypeFactory, org.apache.flink.table.types.DataType inputDataType, org.apache.flink.table.api.Schema declaredSchema, boolean mergePhysicalSchema)Converts the givenDataTypeand an optional declaredSchema(possibly incomplete) into the finalSchemaTranslator.ConsumingResult.static SchemaTranslator.ProducingResultcreateProducingResult(org.apache.flink.table.catalog.DataTypeFactory dataTypeFactory, org.apache.flink.table.catalog.ResolvedSchema inputSchema, org.apache.flink.table.types.AbstractDataType<?> targetDataType)Converts the givenDataTypeinto the finalSchemaTranslator.ProducingResult.static SchemaTranslator.ProducingResultcreateProducingResult(org.apache.flink.table.catalog.ResolvedSchema inputSchema, org.apache.flink.table.api.Schema declaredSchema)Converts the givenDataTypeinto the finalSchemaTranslator.ProducingResult.
-
-
-
Method Detail
-
createProducingResult
public static SchemaTranslator.ProducingResult createProducingResult(org.apache.flink.table.catalog.ResolvedSchema inputSchema, @Nullable org.apache.flink.table.api.Schema declaredSchema)
Converts the givenDataTypeinto the finalSchemaTranslator.ProducingResult.This method serves three types of use cases:
- 1. Derive physical columns from the input schema.
- 2. Derive physical columns from the input schema but enrich with metadata column and primary key.
- 3. Entirely use declared schema.
-
createProducingResult
public static SchemaTranslator.ProducingResult createProducingResult(org.apache.flink.table.catalog.DataTypeFactory dataTypeFactory, org.apache.flink.table.catalog.ResolvedSchema inputSchema, org.apache.flink.table.types.AbstractDataType<?> targetDataType)
Converts the givenDataTypeinto the finalSchemaTranslator.ProducingResult.This method serves one type of use case:
- 1. Derive physical columns from the input data type.
-
createConsumingResult
public static SchemaTranslator.ConsumingResult createConsumingResult(org.apache.flink.table.catalog.DataTypeFactory dataTypeFactory, org.apache.flink.api.common.typeinfo.TypeInformation<?> inputTypeInfo, @Nullable org.apache.flink.table.api.Schema declaredSchema)
Converts the givenTypeInformationand an optional declaredSchema(possibly incomplete) into the finalSchemaTranslator.ConsumingResult.This method serves three types of use cases:
- 1. Derive physical columns from the input type information.
- 2. Derive physical columns but merge them with declared computed columns and other schema information.
- 3. Derive and enrich physical columns and merge other schema information.
-
createConsumingResult
public static SchemaTranslator.ConsumingResult createConsumingResult(org.apache.flink.table.catalog.DataTypeFactory dataTypeFactory, org.apache.flink.table.types.DataType inputDataType, @Nullable org.apache.flink.table.api.Schema declaredSchema, boolean mergePhysicalSchema)
Converts the givenDataTypeand an optional declaredSchema(possibly incomplete) into the finalSchemaTranslator.ConsumingResult.This method serves three types of use cases:
- 1. Derive physical columns from the input data type.
- 2. Derive physical columns but merge them with declared computed columns and other schema information.
- 3. Derive and enrich physical columns and merge other schema information (only if
{@param mergePhysicalSchema} is set to
true).
-
-