@Internal public final class TypeInfoDataTypeConverter extends Object
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:
TypeInformation are mapped to LogicalType including
nullability that is aligned with serializers.
TupleTypeInfoBase is translated into RowType or StructuredType.
BigDecimal is converted to DECIMAL(38, 18) by default.
PojoTypeInfo fields is determined by the converter.
GenericTypeInfo and other type information that cannot be mapped to a logical type
is converted to RawType by considering the current configuration.
TypeInformation that originated from Table API will keep its DataType
information when implementing DataTypeQueryable.
| Constructor and Description |
|---|
TypeInfoDataTypeConverter() |
| Modifier and Type | Method and Description |
|---|---|
static DataType |
toDataType(DataTypeFactory dataTypeFactory,
org.apache.flink.api.common.typeinfo.TypeInformation<?> typeInfo)
Converts the given
TypeInformation into DataType. |
static DataType |
toDataType(DataTypeFactory dataTypeFactory,
org.apache.flink.api.common.typeinfo.TypeInformation<?> typeInfo,
boolean forceNullability)
Converts the given
TypeInformation into DataType but allows to make all
fields nullable independent of the nullability in the serialization stack. |
public static DataType toDataType(DataTypeFactory dataTypeFactory, org.apache.flink.api.common.typeinfo.TypeInformation<?> typeInfo)
TypeInformation into DataType.public static DataType toDataType(DataTypeFactory dataTypeFactory, org.apache.flink.api.common.typeinfo.TypeInformation<?> typeInfo, boolean forceNullability)
TypeInformation into DataType but allows to make all
fields nullable independent of the nullability in the serialization stack.Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.