Package org.apache.flink.sql.parser.ddl
Class SqlAlterTableAdd
java.lang.Object
org.apache.calcite.sql.SqlNode
org.apache.calcite.sql.SqlCall
org.apache.flink.sql.parser.ddl.SqlAlterTable
org.apache.flink.sql.parser.ddl.SqlAlterTableSchema
org.apache.flink.sql.parser.ddl.SqlAlterTableAdd
- All Implemented Interfaces:
Cloneable,ExtendedSqlNode
SqlNode to describe ALTER TABLE [IF EXISTS] table_name ADD column/constraint/watermark clause.
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
);
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.flink.sql.parser.ddl.SqlAlterTable
SqlAlterTable.AlterTableContext -
Field Summary
Fields inherited from class org.apache.flink.sql.parser.ddl.SqlAlterTableSchema
columnList, constraints, distribution, watermarkFields inherited from class org.apache.flink.sql.parser.ddl.SqlAlterTable
ifTableExists, OPERATOR, partitionSpec, tableIdentifierFields inherited from class org.apache.calcite.sql.SqlNode
EMPTY_ARRAY, pos -
Constructor Summary
ConstructorsConstructorDescriptionSqlAlterTableAdd(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) -
Method Summary
Modifier and TypeMethodDescriptionvoidunparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec) Methods inherited from class org.apache.flink.sql.parser.ddl.SqlAlterTableSchema
getColumnPositions, getConstraints, getDistribution, getFullConstraint, getOperandList, getWatermark, validateMethods inherited from class org.apache.flink.sql.parser.ddl.SqlAlterTable
fullTableName, getOperator, getPartitionKVs, getPartitionSpec, getTableName, ifTableExistsMethods inherited from class org.apache.calcite.sql.SqlCall
accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getKind, getMonotonicity, isCountStar, isExpanded, operand, operandCount, setOperand, validateMethods inherited from class org.apache.calcite.sql.SqlNode
clone, clone, cloneArray, equalDeep, equalDeep, equalsDeep, getParserPosition, isA, toList, toList, toSqlString, toSqlString, toSqlString, toString, unparseWithParentheses, validateExpr
-
Constructor Details
-
SqlAlterTableAdd
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)
-
-
Method Details
-
unparse
public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec) - Overrides:
unparsein classSqlAlterTable
-