Class LogicalRelDataTypeConverter

java.lang.Object
org.apache.flink.table.planner.typeutils.LogicalRelDataTypeConverter

@Internal public final class LogicalRelDataTypeConverter extends Object
Symmetric converter between LogicalType and RelDataType.

This converter has many similarities with FlinkTypeFactory and might also replace it at some point. However, for now it is more consistent and does not lose information (i.e. for TIME(9) or interval types). It still delegates to RelDataTypeFactory but only for predefined/basic types.

Note: The conversion to LogicalType is not 100% symmetric and is currently optimized for expressions. Information about the StructKind of a RelRecordType is always set to StructKind.PEEK_FIELDS_NO_EXPAND. Missing precision and scale will be filled with Flink's default values such that all resulting LogicalTypes will be fully resolved.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.flink.table.types.logical.LogicalType
    toLogicalType(org.apache.calcite.rel.type.RelDataType relDataType, org.apache.flink.table.catalog.DataTypeFactory dataTypeFactory)
     
    static org.apache.calcite.rel.type.RelDataType
    toRelDataType(org.apache.flink.table.types.logical.LogicalType logicalType, org.apache.calcite.rel.type.RelDataTypeFactory relDataTypeFactory)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LogicalRelDataTypeConverter

      public LogicalRelDataTypeConverter()
  • Method Details

    • toRelDataType

      public static org.apache.calcite.rel.type.RelDataType toRelDataType(org.apache.flink.table.types.logical.LogicalType logicalType, org.apache.calcite.rel.type.RelDataTypeFactory relDataTypeFactory)
    • toLogicalType

      public static org.apache.flink.table.types.logical.LogicalType toLogicalType(org.apache.calcite.rel.type.RelDataType relDataType, org.apache.flink.table.catalog.DataTypeFactory dataTypeFactory)