Class ExtendedSqlRowTypeNameSpec

java.lang.Object
org.apache.calcite.sql.SqlTypeNameSpec
org.apache.flink.sql.parser.type.ExtendedSqlRowTypeNameSpec

public class ExtendedSqlRowTypeNameSpec extends org.apache.calcite.sql.SqlTypeNameSpec
A sql type name specification of ROW type.

The difference with SqlRowTypeNameSpec:

  • Support comment syntax for every field
  • Field data type default is nullable
  • Support ROW type with empty fields, e.g. ROW()
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExtendedSqlRowTypeNameSpec(org.apache.calcite.sql.parser.SqlParserPos pos, List<org.apache.calcite.sql.SqlIdentifier> fieldNames, List<org.apache.calcite.sql.SqlDataTypeSpec> fieldTypes, List<org.apache.calcite.sql.SqlCharStringLiteral> comments, boolean unparseAsStandard)
    Creates a ROW type specification.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.calcite.rel.type.RelDataType
    deriveType(org.apache.calcite.sql.validate.SqlValidator sqlValidator)
     
    boolean
    equalsDeep(org.apache.calcite.sql.SqlTypeNameSpec node, org.apache.calcite.util.Litmus litmus)
     
    List<org.apache.calcite.sql.SqlCharStringLiteral>
     
    List<org.apache.calcite.sql.SqlIdentifier>
     
    List<org.apache.calcite.sql.SqlDataTypeSpec>
     
    void
    unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)
     
    boolean
     

    Methods inherited from class org.apache.calcite.sql.SqlTypeNameSpec

    getParserPos, getTypeName

    Methods inherited from class java.lang.Object

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

    • ExtendedSqlRowTypeNameSpec

      public ExtendedSqlRowTypeNameSpec(org.apache.calcite.sql.parser.SqlParserPos pos, List<org.apache.calcite.sql.SqlIdentifier> fieldNames, List<org.apache.calcite.sql.SqlDataTypeSpec> fieldTypes, List<org.apache.calcite.sql.SqlCharStringLiteral> comments, boolean unparseAsStandard)
      Creates a ROW type specification.
      Parameters:
      pos - parser position
      fieldNames - field names
      fieldTypes - field data types
      comments - field comments
      unparseAsStandard - whether to unparse as standard SQL style
  • Method Details

    • getFieldNames

      public List<org.apache.calcite.sql.SqlIdentifier> getFieldNames()
    • getFieldTypes

      public List<org.apache.calcite.sql.SqlDataTypeSpec> getFieldTypes()
    • getComments

      public List<org.apache.calcite.sql.SqlCharStringLiteral> getComments()
    • unparseAsStandard

      public boolean unparseAsStandard()
    • unparse

      public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)
      Specified by:
      unparse in class org.apache.calcite.sql.SqlTypeNameSpec
    • equalsDeep

      public boolean equalsDeep(org.apache.calcite.sql.SqlTypeNameSpec node, org.apache.calcite.util.Litmus litmus)
      Specified by:
      equalsDeep in class org.apache.calcite.sql.SqlTypeNameSpec
    • deriveType

      public org.apache.calcite.rel.type.RelDataType deriveType(org.apache.calcite.sql.validate.SqlValidator sqlValidator)
      Specified by:
      deriveType in class org.apache.calcite.sql.SqlTypeNameSpec