Class 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.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

      • of

        public static <T> InternalTypeInfo<T> of​(org.apache.flink.table.types.logical.LogicalType type)
        Creates type information for a LogicalType that 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 a RowType represented 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 for RowType represented 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 for RowType represented 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()
      • toRowFieldTypes

        @Deprecated
        public org.apache.flink.table.types.logical.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.
      • getDataType

        public org.apache.flink.table.types.DataType getDataType()
        Specified by:
        getDataType in interface org.apache.flink.table.types.DataTypeQueryable
      • isBasicType

        public boolean isBasicType()
        Specified by:
        isBasicType in class org.apache.flink.api.common.typeinfo.TypeInformation<T>
      • isTupleType

        public boolean isTupleType()
        Specified by:
        isTupleType in class org.apache.flink.api.common.typeinfo.TypeInformation<T>
      • getArity

        public int getArity()
        Specified by:
        getArity in class org.apache.flink.api.common.typeinfo.TypeInformation<T>
      • getTotalFields

        public int getTotalFields()
        Specified by:
        getTotalFields in class org.apache.flink.api.common.typeinfo.TypeInformation<T>
      • getTypeClass

        public Class<T> getTypeClass()
        Specified by:
        getTypeClass in class org.apache.flink.api.common.typeinfo.TypeInformation<T>
      • isKeyType

        public boolean isKeyType()
        Specified by:
        isKeyType in class org.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:
        createSerializer in class org.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:
        createSerializer in class org.apache.flink.api.common.typeinfo.TypeInformation<T>
      • toString

        public String toString()
        Specified by:
        toString in class org.apache.flink.api.common.typeinfo.TypeInformation<T>
      • equals

        public boolean equals​(Object o)
        Specified by:
        equals in class org.apache.flink.api.common.typeinfo.TypeInformation<T>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in class org.apache.flink.api.common.typeinfo.TypeInformation<T>
      • canEqual

        public boolean canEqual​(Object obj)
        Specified by:
        canEqual in class org.apache.flink.api.common.typeinfo.TypeInformation<T>