public class SqlCreateTableLike extends SqlCreateTable
SqlNode
to 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;
SqlCreateTable.TableCreationContext
Modifier and Type | Field and Description |
---|---|
static org.apache.calcite.sql.SqlSpecialOperator |
OPERATOR |
Constructor and 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,
SqlDistribution distribution,
org.apache.calcite.sql.SqlNodeList partitionKeyList,
SqlWatermark watermark,
org.apache.calcite.sql.SqlCharStringLiteral comment,
SqlTableLike tableLike,
boolean isTemporary,
boolean ifNotExists) |
Modifier and Type | Method and Description |
---|---|
List<org.apache.calcite.sql.SqlNode> |
getOperandList() |
org.apache.calcite.sql.SqlOperator |
getOperator() |
SqlTableLike |
getTableLike() |
void |
unparse(org.apache.calcite.sql.SqlWriter writer,
int leftPrec,
int rightPrec) |
void |
validate() |
fullTableName, getColumnList, getColumnSqlString, getComment, getDistribution, getFullConstraints, getPartitionKeyList, getPropertyList, getTableConstraints, getTableName, getWatermark, hasRegularColumnsOnly, isIfNotExists, isTemporary
accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getKind, getMonotonicity, isCountStar, isExpanded, operand, operandCount, setOperand, validate
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, SqlDistribution distribution, org.apache.calcite.sql.SqlNodeList partitionKeyList, @Nullable SqlWatermark watermark, @Nullable org.apache.calcite.sql.SqlCharStringLiteral comment, SqlTableLike tableLike, boolean isTemporary, boolean ifNotExists)
@Nonnull public org.apache.calcite.sql.SqlOperator getOperator()
getOperator
in class SqlCreateTable
@Nonnull public List<org.apache.calcite.sql.SqlNode> getOperandList()
getOperandList
in class SqlCreateTable
public void validate() throws SqlValidateException
validate
in interface ExtendedSqlNode
validate
in class SqlCreateTable
SqlValidateException
public SqlTableLike getTableLike()
public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)
unparse
in class SqlCreateTable
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.