T
- internal data structure@Internal public final class InternalTypeInfo<T> extends TypeInformation<T> implements DataTypeQueryable
LogicalType
.
TypeInformation
is a legacy class for the sole purpose of creating a TypeSerializer
. Instances of TypeInformation
are not required in the table ecosystem but
sometimes enforced by interfaces of other modules (such as Transformation
). 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 the LogicalType
directly.
The original LogicalType
is stored in every instance (for access during pre-flight
phase and planning) but has no effect on equality because only serialization matters during
runtime.
Modifier and Type | Method and Description |
---|---|
boolean |
canEqual(Object obj)
Returns true if the given object can be equaled with this object.
|
TypeSerializer<T> |
createSerializer(ExecutionConfig config)
Create
TypeSerializer for this type. |
TypeSerializer<T> |
createSerializer(SerializerConfig config)
Creates a serializer for the type.
|
boolean |
equals(Object o) |
int |
getArity()
Gets the arity of this type - the number of fields without nesting.
|
DataType |
getDataType() |
int |
getTotalFields()
Gets the number of logical fields in this type.
|
Class<T> |
getTypeClass()
Gets the class of the type represented by this type information.
|
int |
hashCode() |
boolean |
isBasicType()
Checks if this type information represents a basic type.
|
boolean |
isKeyType()
Checks whether this type can be used as a key.
|
boolean |
isTupleType()
Checks if this type information represents a Tuple type.
|
static <T> InternalTypeInfo<T> |
of(LogicalType type)
Creates type information for a
LogicalType that is represented by internal data
structures. |
static InternalTypeInfo<RowData> |
of(RowType type)
Creates type information for a
RowType represented by internal data structures. |
static InternalTypeInfo<RowData> |
ofFields(LogicalType... fieldTypes)
Creates type information for
RowType represented by internal data structures. |
static InternalTypeInfo<RowData> |
ofFields(LogicalType[] fieldTypes,
String[] fieldNames)
Creates type information for
RowType represented by internal data structures. |
LogicalType |
toLogicalType() |
String[] |
toRowFieldNames()
Deprecated.
TypeInformation should just be a thin wrapper of a serializer. This
method only exists for legacy code. It is recommended to use the RowType instead
for logical operations. |
LogicalType[] |
toRowFieldTypes()
Deprecated.
TypeInformation should just be a thin wrapper of a serializer. This
method only exists for legacy code. It is recommended to use the RowType instead
for logical operations. |
RowDataSerializer |
toRowSerializer() |
int |
toRowSize()
Deprecated.
TypeInformation should just be a thin wrapper of a serializer. This
method only exists for legacy code. It is recommended to use the RowType instead
for logical operations. |
RowType |
toRowType() |
TypeSerializer<T> |
toSerializer() |
String |
toString() |
getGenericParameters, isSortKeyType, of, of
public static <T> InternalTypeInfo<T> of(LogicalType type)
LogicalType
that is represented by internal data
structures.public static InternalTypeInfo<RowData> of(RowType type)
RowType
represented by internal data structures.public static InternalTypeInfo<RowData> ofFields(LogicalType... fieldTypes)
RowType
represented by internal data structures.public static InternalTypeInfo<RowData> ofFields(LogicalType[] fieldTypes, String[] fieldNames)
RowType
represented by internal data structures.public LogicalType toLogicalType()
public TypeSerializer<T> toSerializer()
public RowType toRowType()
public RowDataSerializer toRowSerializer()
@Deprecated public LogicalType[] toRowFieldTypes()
TypeInformation
should just be a thin wrapper of a serializer. This
method only exists for legacy code. It is recommended to use the RowType
instead
for logical operations.@Deprecated public String[] toRowFieldNames()
TypeInformation
should just be a thin wrapper of a serializer. This
method only exists for legacy code. It is recommended to use the RowType
instead
for logical operations.@Deprecated public int toRowSize()
TypeInformation
should just be a thin wrapper of a serializer. This
method only exists for legacy code. It is recommended to use the RowType
instead
for logical operations.public DataType getDataType()
getDataType
in interface DataTypeQueryable
public boolean isBasicType()
TypeInformation
BasicTypeInfo
and are primitives, their boxing types, Strings, Date, Void, ...isBasicType
in class TypeInformation<T>
public boolean isTupleType()
TypeInformation
isTupleType
in class TypeInformation<T>
public int getArity()
TypeInformation
getArity
in class TypeInformation<T>
public int getTotalFields()
TypeInformation
The total number of fields must be at least 1.
getTotalFields
in class TypeInformation<T>
public Class<T> getTypeClass()
TypeInformation
getTypeClass
in class TypeInformation<T>
public boolean isKeyType()
TypeInformation
isKeyType
in class TypeInformation<T>
public TypeSerializer<T> createSerializer(SerializerConfig config)
TypeInformation
createSerializer
in class TypeInformation<T>
config
- The config used to parameterize the serializer.public TypeSerializer<T> createSerializer(ExecutionConfig config)
TypeInformation
TypeSerializer
for this type.createSerializer
in class TypeInformation<T>
config
- the configuration of this job executionpublic String toString()
toString
in class TypeInformation<T>
public boolean equals(Object o)
equals
in class TypeInformation<T>
public int hashCode()
hashCode
in class TypeInformation<T>
public boolean canEqual(Object obj)
TypeInformation
canEqual
in class TypeInformation<T>
obj
- Object which wants to take part in the equality relationCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.