Class InternalTypeInfo<T>

  • Type Parameters:
    T - internal data structure
    All Implemented Interfaces:
    Serializable, DataTypeQueryable

    @Internal
    public final class InternalTypeInfo<T>
    extends TypeInformation<T>
    implements DataTypeQueryable
    Type information that wraps a serializer that originated from a 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.

    See Also:
    Serialized Form
    • Method Detail

      • toRowType

        public RowType toRowType()
      • toRowFieldTypes

        @Deprecated
        public 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.
      • toRowFieldNames

        @Deprecated
        public 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.
      • toRowSize

        @Deprecated
        public 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.
      • isBasicType

        public boolean isBasicType()
        Description copied from class: TypeInformation
        Checks if this type information represents a basic type. Basic types are defined in BasicTypeInfo and are primitives, their boxing types, Strings, Date, Void, ...
        Specified by:
        isBasicType in class TypeInformation<T>
        Returns:
        True, if this type information describes a basic type, false otherwise.
      • isTupleType

        public boolean isTupleType()
        Description copied from class: TypeInformation
        Checks if this type information represents a Tuple type. Tuple types are subclasses of the Java API tuples.
        Specified by:
        isTupleType in class TypeInformation<T>
        Returns:
        True, if this type information describes a tuple type, false otherwise.
      • getArity

        public int getArity()
        Description copied from class: TypeInformation
        Gets the arity of this type - the number of fields without nesting.
        Specified by:
        getArity in class TypeInformation<T>
        Returns:
        Gets the number of fields in this type without nesting.
      • getTotalFields

        public int getTotalFields()
        Description copied from class: TypeInformation
        Gets the number of logical fields in this type. This includes its nested and transitively nested fields, in the case of composite types. In the example above, the OuterType type has three fields in total.

        The total number of fields must be at least 1.

        Specified by:
        getTotalFields in class TypeInformation<T>
        Returns:
        The number of fields in this type, including its sub-fields (for composite types)
      • getTypeClass

        public Class<T> getTypeClass()
        Description copied from class: TypeInformation
        Gets the class of the type represented by this type information.
        Specified by:
        getTypeClass in class TypeInformation<T>
        Returns:
        The class of the type represented by this type information.
      • isKeyType

        public boolean isKeyType()
        Description copied from class: TypeInformation
        Checks whether this type can be used as a key. As a bare minimum, types have to be hashable and comparable to be keys.
        Specified by:
        isKeyType in class TypeInformation<T>
        Returns:
        True, if the type can be used as a key, false otherwise.
      • createSerializer

        public TypeSerializer<T> createSerializer​(SerializerConfig config)
        Description copied from class: TypeInformation
        Creates a serializer for the type. The serializer may use the ExecutionConfig for parameterization.
        Specified by:
        createSerializer in class TypeInformation<T>
        Parameters:
        config - The config used to parameterize the serializer.
        Returns:
        A serializer for this type.
      • canEqual

        public boolean canEqual​(Object obj)
        Description copied from class: TypeInformation
        Returns true if the given object can be equaled with this object. If not, it returns false.
        Specified by:
        canEqual in class TypeInformation<T>
        Parameters:
        obj - Object which wants to take part in the equality relation
        Returns:
        true if obj can be equaled with this, otherwise false