Package org.apache.flink.sql.parser.ddl
Class SqlCreateTableLike
- java.lang.Object
-
- org.apache.calcite.sql.SqlNode
-
- org.apache.calcite.sql.SqlCall
-
- org.apache.calcite.sql.SqlDdl
-
- org.apache.calcite.sql.SqlCreate
-
- org.apache.flink.sql.parser.ddl.SqlCreateTable
-
- org.apache.flink.sql.parser.ddl.SqlCreateTableLike
-
- All Implemented Interfaces:
Cloneable,ExtendedSqlNode
public class SqlCreateTableLike extends SqlCreateTable
SqlNodeto describe the CREATE TABLE LIKE syntax. CREATE TABLE LIKE syntax is similar as CREATE TABLE syntax, besides it has LIKE sub-clause to inherit property of an existed table.Example:
CREATE TABLE base_table ( id BIGINT, name STRING, tstmp TIMESTAMP, PRIMARY KEY(id) ) WITH ( ‘connector’ = ‘kafka’, ‘connector.starting-offset’: ‘12345’, ‘format’ = ‘json’ ) CREATE TABLE derived_table ( a int ) WITH ( 'connector' = 'jdbc', 'url' = 'http://localhost:10000', 'table-name' = 'derivedTable' ) LIKE base_table;
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.sql.parser.ddl.SqlCreateTable
SqlCreateTable.TableCreationContext
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.calcite.sql.SqlSpecialOperatorOPERATOR
-
Constructor Summary
Constructors Constructor Description SqlCreateTableLike(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlIdentifier tableName, org.apache.calcite.sql.SqlNodeList columnList, List<SqlTableConstraint> tableConstraints, org.apache.calcite.sql.SqlNodeList propertyList, org.apache.calcite.sql.SqlNodeList partitionKeyList, SqlWatermark watermark, org.apache.calcite.sql.SqlCharStringLiteral comment, SqlTableLike tableLike, boolean isTemporary, boolean ifNotExists)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.apache.calcite.sql.SqlNode>getOperandList()org.apache.calcite.sql.SqlOperatorgetOperator()SqlTableLikegetTableLike()voidunparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)voidvalidate()-
Methods inherited from class org.apache.flink.sql.parser.ddl.SqlCreateTable
fullTableName, getColumnList, getColumnSqlString, getComment, getFullConstraints, getPartitionKeyList, getPropertyList, getTableConstraints, getTableName, getWatermark, hasRegularColumnsOnly, isIfNotExists, isTemporary
-
Methods inherited from class org.apache.calcite.sql.SqlCall
accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getKind, getMonotonicity, isCountStar, isExpanded, operand, operandCount, setOperand, validate
-
-
-
-
Constructor Detail
-
SqlCreateTableLike
public SqlCreateTableLike(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlIdentifier tableName, org.apache.calcite.sql.SqlNodeList columnList, List<SqlTableConstraint> tableConstraints, org.apache.calcite.sql.SqlNodeList propertyList, org.apache.calcite.sql.SqlNodeList partitionKeyList, @Nullable SqlWatermark watermark, @Nullable org.apache.calcite.sql.SqlCharStringLiteral comment, SqlTableLike tableLike, boolean isTemporary, boolean ifNotExists)
-
-
Method Detail
-
getOperator
@Nonnull public org.apache.calcite.sql.SqlOperator getOperator()
- Overrides:
getOperatorin classSqlCreateTable
-
getOperandList
@Nonnull public List<org.apache.calcite.sql.SqlNode> getOperandList()
- Overrides:
getOperandListin classSqlCreateTable
-
validate
public void validate() throws SqlValidateException- Specified by:
validatein interfaceExtendedSqlNode- Overrides:
validatein classSqlCreateTable- Throws:
SqlValidateException
-
getTableLike
public SqlTableLike getTableLike()
-
unparse
public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)- Overrides:
unparsein classSqlCreateTable
-
-