Class 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.
    • Constructor Detail

      • 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 Detail

      • 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