T
- external data structure@Internal public final class ExternalTypeInfo<T> extends TypeInformation<T> implements DataTypeQueryable
DataType
.
TypeInformation
is a legacy class for the sole purpose of creating a TypeSerializer
. This class acts as an adapter when entering or leaving the table ecosystem to
other APIs where type information is required.
The original DataType
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.
Note: This class is incomplete yet and only supports RAW types. But will be updated to support all kinds of data types in the future.
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)
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> ExternalTypeInfo<T> |
of(DataType dataType)
Creates type information for a
DataType that is possibly represented by internal data
structures but serialized and deserialized into external data structures. |
static <T> ExternalTypeInfo<T> |
of(DataType dataType,
boolean isInternalInput)
Creates type information for a
DataType that is possibly represented by internal data
structures but serialized and deserialized into external data structures. |
String |
toString() |
getGenericParameters, isSortKeyType, of, of
public static <T> ExternalTypeInfo<T> of(DataType dataType)
DataType
that is possibly represented by internal data
structures but serialized and deserialized into external data structures.public static <T> ExternalTypeInfo<T> of(DataType dataType, boolean isInternalInput)
DataType
that is possibly represented by internal data
structures but serialized and deserialized into external data structures.isInternalInput
- allows for a non-bidirectional serializer from internal to externalpublic 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(ExecutionConfig config)
TypeInformation
createSerializer
in class TypeInformation<T>
config
- The config used to parameterize the serializer.public 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–2023 The Apache Software Foundation. All rights reserved.