Class InternalTypeInfo<T>
- java.lang.Object
-
- org.apache.flink.api.common.typeinfo.TypeInformation<T>
-
- org.apache.flink.table.runtime.typeutils.InternalTypeInfo<T>
-
- Type Parameters:
T- internal data structure
- All Implemented Interfaces:
Serializable,org.apache.flink.table.types.DataTypeQueryable
@Internal public final class InternalTypeInfo<T> extends org.apache.flink.api.common.typeinfo.TypeInformation<T> implements org.apache.flink.table.types.DataTypeQueryableType information that wraps a serializer that originated from aLogicalType.TypeInformationis a legacy class for the sole purpose of creating aTypeSerializer. Instances ofTypeInformationare not required in the table ecosystem but sometimes enforced by interfaces of other modules (such asTransformation). Therefore, this class acts as an adapter whenever type information is required.Use
of(LogicalType)for type information of internal data structures.Note: Instances of this class should only be created for passing it to interfaces that require type information. This class should not be used as a replacement for a
LogicalType. Information such as the arity of a row type, field types, field names, etc. should be derived from theLogicalTypedirectly.The original
LogicalTypeis stored in every instance (for access during pre-flight phase and planning) but has no effect on equality because only serialization matters during runtime.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancanEqual(Object obj)org.apache.flink.api.common.typeutils.TypeSerializer<T>createSerializer(org.apache.flink.api.common.ExecutionConfig config)org.apache.flink.api.common.typeutils.TypeSerializer<T>createSerializer(org.apache.flink.api.common.serialization.SerializerConfig config)booleanequals(Object o)intgetArity()org.apache.flink.table.types.DataTypegetDataType()intgetTotalFields()Class<T>getTypeClass()inthashCode()booleanisBasicType()booleanisKeyType()booleanisTupleType()static <T> InternalTypeInfo<T>of(org.apache.flink.table.types.logical.LogicalType type)Creates type information for aLogicalTypethat is represented by internal data structures.static InternalTypeInfo<org.apache.flink.table.data.RowData>of(org.apache.flink.table.types.logical.RowType type)Creates type information for aRowTyperepresented by internal data structures.static InternalTypeInfo<org.apache.flink.table.data.RowData>ofFields(org.apache.flink.table.types.logical.LogicalType... fieldTypes)Creates type information forRowTyperepresented by internal data structures.static InternalTypeInfo<org.apache.flink.table.data.RowData>ofFields(org.apache.flink.table.types.logical.LogicalType[] fieldTypes, String[] fieldNames)Creates type information forRowTyperepresented by internal data structures.org.apache.flink.table.types.logical.LogicalTypetoLogicalType()String[]toRowFieldNames()Deprecated.TypeInformationshould just be a thin wrapper of a serializer.org.apache.flink.table.types.logical.LogicalType[]toRowFieldTypes()Deprecated.TypeInformationshould just be a thin wrapper of a serializer.RowDataSerializertoRowSerializer()inttoRowSize()Deprecated.TypeInformationshould just be a thin wrapper of a serializer.org.apache.flink.table.types.logical.RowTypetoRowType()org.apache.flink.api.common.typeutils.TypeSerializer<T>toSerializer()StringtoString()
-
-
-
Method Detail
-
of
public static <T> InternalTypeInfo<T> of(org.apache.flink.table.types.logical.LogicalType type)
Creates type information for aLogicalTypethat is represented by internal data structures.
-
of
public static InternalTypeInfo<org.apache.flink.table.data.RowData> of(org.apache.flink.table.types.logical.RowType type)
Creates type information for aRowTyperepresented by internal data structures.
-
ofFields
public static InternalTypeInfo<org.apache.flink.table.data.RowData> ofFields(org.apache.flink.table.types.logical.LogicalType... fieldTypes)
Creates type information forRowTyperepresented by internal data structures.
-
ofFields
public static InternalTypeInfo<org.apache.flink.table.data.RowData> ofFields(org.apache.flink.table.types.logical.LogicalType[] fieldTypes, String[] fieldNames)
Creates type information forRowTyperepresented by internal data structures.
-
toLogicalType
public org.apache.flink.table.types.logical.LogicalType toLogicalType()
-
toSerializer
public org.apache.flink.api.common.typeutils.TypeSerializer<T> toSerializer()
-
toRowType
public org.apache.flink.table.types.logical.RowType toRowType()
-
toRowSerializer
public RowDataSerializer toRowSerializer()
-
toRowFieldTypes
@Deprecated public org.apache.flink.table.types.logical.LogicalType[] toRowFieldTypes()
Deprecated.TypeInformationshould just be a thin wrapper of a serializer. This method only exists for legacy code. It is recommended to use theRowTypeinstead for logical operations.
-
toRowFieldNames
@Deprecated public String[] toRowFieldNames()
Deprecated.TypeInformationshould just be a thin wrapper of a serializer. This method only exists for legacy code. It is recommended to use theRowTypeinstead for logical operations.
-
toRowSize
@Deprecated public int toRowSize()
Deprecated.TypeInformationshould just be a thin wrapper of a serializer. This method only exists for legacy code. It is recommended to use theRowTypeinstead for logical operations.
-
getDataType
public org.apache.flink.table.types.DataType getDataType()
- Specified by:
getDataTypein interfaceorg.apache.flink.table.types.DataTypeQueryable
-
isBasicType
public boolean isBasicType()
- Specified by:
isBasicTypein classorg.apache.flink.api.common.typeinfo.TypeInformation<T>
-
isTupleType
public boolean isTupleType()
- Specified by:
isTupleTypein classorg.apache.flink.api.common.typeinfo.TypeInformation<T>
-
getArity
public int getArity()
- Specified by:
getArityin classorg.apache.flink.api.common.typeinfo.TypeInformation<T>
-
getTotalFields
public int getTotalFields()
- Specified by:
getTotalFieldsin classorg.apache.flink.api.common.typeinfo.TypeInformation<T>
-
getTypeClass
public Class<T> getTypeClass()
- Specified by:
getTypeClassin classorg.apache.flink.api.common.typeinfo.TypeInformation<T>
-
isKeyType
public boolean isKeyType()
- Specified by:
isKeyTypein classorg.apache.flink.api.common.typeinfo.TypeInformation<T>
-
createSerializer
public org.apache.flink.api.common.typeutils.TypeSerializer<T> createSerializer(org.apache.flink.api.common.serialization.SerializerConfig config)
- Overrides:
createSerializerin classorg.apache.flink.api.common.typeinfo.TypeInformation<T>
-
createSerializer
public org.apache.flink.api.common.typeutils.TypeSerializer<T> createSerializer(org.apache.flink.api.common.ExecutionConfig config)
- Specified by:
createSerializerin classorg.apache.flink.api.common.typeinfo.TypeInformation<T>
-
toString
public String toString()
- Specified by:
toStringin classorg.apache.flink.api.common.typeinfo.TypeInformation<T>
-
equals
public boolean equals(Object o)
- Specified by:
equalsin classorg.apache.flink.api.common.typeinfo.TypeInformation<T>
-
hashCode
public int hashCode()
- Specified by:
hashCodein classorg.apache.flink.api.common.typeinfo.TypeInformation<T>
-
-