Package org.apache.flink.table.catalog
Class SchemaTranslator
java.lang.Object
org.apache.flink.table.catalog.SchemaTranslator
Utility to derive a physical
DataType, Schema, and projections for sinks and
sources.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateConsumingResult(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.createConsumingResult(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.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.createProducingResult(org.apache.flink.table.catalog.ResolvedSchema inputSchema, org.apache.flink.table.api.Schema declaredSchema) Converts the givenDataTypeinto the finalSchemaTranslator.ProducingResult.
-
Constructor Details
-
SchemaTranslator
public SchemaTranslator()
-
-
Method Details
-
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
is set to
true).
-