Class SqlAlterTableModify

  • All Implemented Interfaces:
    Cloneable, ExtendedSqlNode

    public class SqlAlterTableModify
    extends SqlAlterTableSchema
    SqlNode to describe ALTER TABLE [IF EXISTS] table_name MODIFY column/constraint/watermark clause.

    Example: DDL like the below for modify column/constraint/watermark.

    
     -- modify single column
     ALTER TABLE mytable MODIFY new_column STRING COMMENT 'new_column docs';
    
     -- modify multiple columns, constraint, and watermark
     ALTER TABLE mytable MODIFY (
         log_ts STRING COMMENT 'log timestamp string' FIRST,
         ts AS TO_TIMESTAMP(log_ts) AFTER log_ts,
         col_meta int metadata from 'mk1' virtual AFTER col_b,
         PRIMARY KEY (id) NOT ENFORCED,
         WATERMARK FOR ts AS ts - INTERVAL '3' SECOND
     );
     
    • Constructor Detail

      • SqlAlterTableModify

        public SqlAlterTableModify​(org.apache.calcite.sql.parser.SqlParserPos pos,
                                   org.apache.calcite.sql.SqlIdentifier tableName,
                                   org.apache.calcite.sql.SqlNodeList modifiedColumns,
                                   List<SqlTableConstraint> constraints,
                                   @Nullable
                                   SqlWatermark watermark,
                                   @Nullable
                                   SqlDistribution distribution,
                                   boolean ifTableExists)
    • Method Detail

      • unparse

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