public class SqlAlterTableAdd extends SqlAlterTableSchema
Example: DDL like the below for add column/constraint/watermark.
-- add single column
ALTER TABLE mytable ADD new_column STRING COMMENT 'new_column docs';
-- add multiple columns, constraint, and watermark
ALTER TABLE mytable ADD (
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
);
SqlAlterTable.AlterTableContext
columnList, constraints, distribution, watermark
ifTableExists, OPERATOR, partitionSpec, tableIdentifier
Constructor and Description |
---|
SqlAlterTableAdd(org.apache.calcite.sql.parser.SqlParserPos pos,
org.apache.calcite.sql.SqlIdentifier tableName,
org.apache.calcite.sql.SqlNodeList addedColumns,
List<SqlTableConstraint> constraint,
SqlWatermark sqlWatermark,
SqlDistribution distribution,
boolean ifTableExists) |
Modifier and Type | Method and Description |
---|---|
void |
unparse(org.apache.calcite.sql.SqlWriter writer,
int leftPrec,
int rightPrec) |
getColumnPositions, getConstraints, getDistribution, getFullConstraint, getOperandList, getWatermark, validate
fullTableName, getOperator, getPartitionKVs, getPartitionSpec, getTableName, ifTableExists
accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getKind, getMonotonicity, isCountStar, isExpanded, operand, operandCount, setOperand, validate
public SqlAlterTableAdd(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlIdentifier tableName, org.apache.calcite.sql.SqlNodeList addedColumns, List<SqlTableConstraint> constraint, @Nullable SqlWatermark sqlWatermark, @Nullable SqlDistribution distribution, boolean ifTableExists)
public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)
unparse
in class SqlAlterTable
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.