Interface DataTypeFactory
The factory is useful for types that cannot be created with one of the static methods in
DataTypes) because they require access to configuration or catalog.
-
Method Summary
Modifier and TypeMethodDescription<T> DataTypecreateDataType(Class<T> clazz) Creates a type by analyzing the given class.createDataType(String typeString) Creates a type by a fully or partially defined name.<T> DataTypecreateDataType(org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo) Creates a type for the givenTypeInformation.createDataType(UnresolvedIdentifier identifier) Creates a type by a fully or partially defined identifier.createDataType(AbstractDataType<?> abstractDataType) Creates a type out of anAbstractDataType.createLogicalType(String typeString) Creates aLogicalTypeby a fully or partially defined name.createLogicalType(UnresolvedIdentifier identifier) Creates aLogicalTypefrom anUnresolvedIdentifierfor resolving user-defined types (seeDistinctTypeandStructuredType).<T> DataTypecreateRawDataType(Class<T> clazz) Creates a RAW type for the given class in cases where no serializer is known and a generic serializer should be used.<T> DataTypecreateRawDataType(org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo) Creates a RAW type for the givenTypeInformation.
-
Method Details
-
createDataType
Creates a type out of anAbstractDataType.If the given type is already a
DataType, the factory will return it unmodified. In case ofUnresolvedDataType, the factory will resolve it to aDataType. -
createDataType
Creates a type by a fully or partially defined name.The factory will parse and resolve the name of a type to a
DataType. This includes both built-in types and user-defined types (seeDistinctTypeandStructuredType). -
createDataType
Creates a type by a fully or partially defined identifier.The factory will parse and resolve the name of a type to a
DataType. This includes both built-in types and user-defined types (seeDistinctTypeandStructuredType). -
createDataType
Creates a type by analyzing the given class.It does this by using Java reflection which can be supported by
DataTypeHintannotations for nested, structured types.It will throw an
ValidationExceptionin cases where the reflective extraction needs more information or simply fails.See
DataTypes.of(Class)for further examples. -
createDataType
Creates a type for the givenTypeInformation.DataTypeis richer thanTypeInformationas it also includes details about theLogicalType. Therefore, some details will be added implicitly during the conversion. The mapping to data type happens on a best effort basis. If no data type is suitable, the type information is interpreted asDataTypes.RAW(Class, TypeSerializer).See
TypeInfoDataTypeConverterfor more information. -
createRawDataType
Creates a RAW type for the given class in cases where no serializer is known and a generic serializer should be used. The factory will createDataTypes.RAW(Class, TypeSerializer)with Flink's default RAW serializer that is automatically configured.Note: This type is a black box within the table ecosystem and is only deserialized at the edges of the API.
-
createRawDataType
Creates a RAW type for the givenTypeInformation. Since type information does not contain aTypeSerializeryet. The serializer will be generated by considering the current configuration.Note: This type is a black box within the table ecosystem and is only deserialized at the edges of the API.
-
createLogicalType
Creates aLogicalTypeby a fully or partially defined name.The factory will parse and resolve the name of a type to a
LogicalType. This includes both built-in types and user-defined types (seeDistinctTypeandStructuredType). -
createLogicalType
Creates aLogicalTypefrom anUnresolvedIdentifierfor resolving user-defined types (seeDistinctTypeandStructuredType).
-