Class TypeInfoDataTypeConverter
- java.lang.Object
-
- org.apache.flink.table.types.utils.TypeInfoDataTypeConverter
-
@Internal public final class TypeInfoDataTypeConverter extends Object
Converter fromTypeInformationtoDataType.DataTypeis richer thanTypeInformationas it also includes details about theLogicalType. Therefore, some details will be added implicitly during the conversion. The conversion fromDataTypetoTypeInformationis provided by the planner.The behavior of this converter can be summarized as follows:
- All subclasses of
TypeInformationare mapped toLogicalTypeincluding nullability that is aligned with serializers. TupleTypeInfoBaseis translated intoRowTypeorStructuredType.BigDecimalis converted toDECIMAL(38, 18)by default.- The order of
PojoTypeInfofields is determined by the converter. GenericTypeInfoand other type information that cannot be mapped to a logical type is converted toRawTypeby considering the current configuration.TypeInformationthat originated from Table API will keep itsDataTypeinformation when implementingDataTypeQueryable.
- All subclasses of
-
-
Constructor Summary
Constructors Constructor Description TypeInfoDataTypeConverter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DataTypetoDataType(DataTypeFactory dataTypeFactory, org.apache.flink.api.common.typeinfo.TypeInformation<?> typeInfo)Converts the givenTypeInformationintoDataType.static DataTypetoDataType(DataTypeFactory dataTypeFactory, org.apache.flink.api.common.typeinfo.TypeInformation<?> typeInfo, boolean forceNullability)Converts the givenTypeInformationintoDataTypebut allows to make all fields nullable independent of the nullability in the serialization stack.
-
-
-
Method Detail
-
toDataType
public static DataType toDataType(DataTypeFactory dataTypeFactory, org.apache.flink.api.common.typeinfo.TypeInformation<?> typeInfo)
Converts the givenTypeInformationintoDataType.
-
toDataType
public static DataType toDataType(DataTypeFactory dataTypeFactory, org.apache.flink.api.common.typeinfo.TypeInformation<?> typeInfo, boolean forceNullability)
Converts the givenTypeInformationintoDataTypebut allows to make all fields nullable independent of the nullability in the serialization stack.
-
-