Class TypeInfoDataTypeConverter
java.lang.Object
org.apache.flink.table.types.utils.TypeInfoDataTypeConverter
Converter from
TypeInformation to DataType.
DataType is richer than TypeInformation as it also includes details about the
LogicalType. Therefore, some details will be added implicitly during the conversion. The
conversion from DataType to TypeInformation is 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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
TypeInfoDataTypeConverter
public TypeInfoDataTypeConverter()
-
-
Method Details
-
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.
-