Class SqlAlterTable

java.lang.Object
org.apache.calcite.sql.SqlNode
org.apache.calcite.sql.SqlCall
org.apache.flink.sql.parser.ddl.SqlAlterTable
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
SqlAddPartitions, SqlAlterTableAddConstraint, SqlAlterTableDropColumn, SqlAlterTableDropConstraint, SqlAlterTableDropDistribution, SqlAlterTableDropPrimaryKey, SqlAlterTableDropWatermark, SqlAlterTableOptions, SqlAlterTableRename, SqlAlterTableRenameColumn, SqlAlterTableReset, SqlAlterTableSchema, SqlDropPartitions

public abstract class SqlAlterTable extends org.apache.calcite.sql.SqlCall
Abstract class to describe statements like ALTER TABLE [IF EXISTS] [[catalogName.] dataBasesName].tableName ...
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Alter table context.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final boolean
     
    static final org.apache.calcite.sql.SqlSpecialOperator
     
    protected final org.apache.calcite.sql.SqlNodeList
     
    protected final org.apache.calcite.sql.SqlIdentifier
     

    Fields inherited from class org.apache.calcite.sql.SqlNode

    EMPTY_ARRAY, pos
  • Constructor Summary

    Constructors
    Constructor
    Description
    SqlAlterTable(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlIdentifier tableName, boolean ifTableExists)
     
    SqlAlterTable(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlIdentifier tableName, org.apache.calcite.sql.SqlNodeList partitionSpec)
     
    SqlAlterTable(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlIdentifier tableName, org.apache.calcite.sql.SqlNodeList partitionSpec, boolean ifTableExists)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    org.apache.calcite.sql.SqlOperator
     
    Get partition spec as key-value strings.
    org.apache.calcite.sql.SqlNodeList
    Returns the partition spec if the ALTER should be applied to partitions, and null otherwise.
    org.apache.calcite.sql.SqlIdentifier
     
    boolean
    Whether to ignore the error if the table doesn't exist.
    void
    unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)
     

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

    accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getKind, getMonotonicity, getOperandList, isCountStar, isExpanded, operand, operandCount, setOperand, validate

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

    clone, clone, cloneArray, equalDeep, equalDeep, equalsDeep, getParserPosition, isA, toList, toList, toSqlString, toSqlString, toSqlString, toString, unparseWithParentheses, validateExpr

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • OPERATOR

      public static final org.apache.calcite.sql.SqlSpecialOperator OPERATOR
    • tableIdentifier

      protected final org.apache.calcite.sql.SqlIdentifier tableIdentifier
    • partitionSpec

      protected final org.apache.calcite.sql.SqlNodeList partitionSpec
    • ifTableExists

      protected final boolean ifTableExists
  • Constructor Details

    • SqlAlterTable

      public SqlAlterTable(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlIdentifier tableName, @Nullable org.apache.calcite.sql.SqlNodeList partitionSpec, boolean ifTableExists)
    • SqlAlterTable

      public SqlAlterTable(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlIdentifier tableName, boolean ifTableExists)
    • SqlAlterTable

      public SqlAlterTable(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlIdentifier tableName, @Nullable org.apache.calcite.sql.SqlNodeList partitionSpec)
  • Method Details

    • getOperator

      public org.apache.calcite.sql.SqlOperator getOperator()
      Specified by:
      getOperator in class org.apache.calcite.sql.SqlCall
    • getTableName

      public org.apache.calcite.sql.SqlIdentifier getTableName()
    • unparse

      public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)
      Overrides:
      unparse in class org.apache.calcite.sql.SqlCall
    • fullTableName

      public String[] fullTableName()
    • getPartitionSpec

      public org.apache.calcite.sql.SqlNodeList getPartitionSpec()
      Returns the partition spec if the ALTER should be applied to partitions, and null otherwise.
    • getPartitionKVs

      public LinkedHashMap<String,String> getPartitionKVs()
      Get partition spec as key-value strings.
    • ifTableExists

      public boolean ifTableExists()
      Whether to ignore the error if the table doesn't exist.
      Returns:
      true when IF EXISTS is specified.