Class SqlAlterMaterializedTableSchema.SqlAlterMaterializedTableAddSchema

  • All Implemented Interfaces:
    Cloneable, ExtendedSqlNode
    Enclosing class:
    SqlAlterMaterializedTableSchema

    public static class SqlAlterMaterializedTableSchema.SqlAlterMaterializedTableAddSchema
    extends SqlAlterMaterializedTableSchema
    Example: DDL like the below for adding column(s)/constraint/watermark.

    Note: adding or modifying persisted columns is not supported, only computed or metadata

    
     -- add single column
     ALTER MATERIALIZED TABLE myMaterializedTable ADD c1 AS current_timestamp COMMENT 'new_column docs';
    
     -- add multiple columns, constraint, and watermark
     ALTER MATERIALIZED TABLE myMaterializedTable ADD (
         ts AS current_timestamp FIRST,
         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

      • SqlAlterMaterializedTableAddSchema

        public SqlAlterMaterializedTableAddSchema​(org.apache.calcite.sql.parser.SqlParserPos pos,
                                                  org.apache.calcite.sql.SqlIdentifier materializedTableName,
                                                  org.apache.calcite.sql.SqlNodeList columnList,
                                                  List<SqlTableConstraint> constraints,
                                                  @Nullable
                                                  SqlWatermark sqlWatermark)