public class SqlCreateTableAs extends SqlCreateTable
SqlNode
to describe the CREATE TABLE AS syntax. The CTAS would create a pipeline to
compute the result of the given query and insert data into the derived 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
WITH (
'connector' = 'jdbc',
'url' = 'http://localhost:10000',
'table-name' = 'syncedTable'
)
AS SELECT * FROM base_table;
SqlCreateTable.TableCreationContext
Modifier and Type | Field and Description |
---|---|
static org.apache.calcite.sql.SqlSpecialOperator |
OPERATOR |
Constructor and Description |
---|
SqlCreateTableAs(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,
org.apache.calcite.sql.SqlNode asQuery,
boolean isTemporary,
boolean ifNotExists) |
Modifier and Type | Method and Description |
---|---|
org.apache.calcite.sql.SqlNode |
getAsQuery() |
List<org.apache.calcite.sql.SqlNode> |
getOperandList() |
org.apache.calcite.sql.SqlOperator |
getOperator() |
void |
unparse(org.apache.calcite.sql.SqlWriter writer,
int leftPrec,
int rightPrec) |
void |
validate() |
fullTableName, getColumnList, getColumnSqlString, getComment, getFullConstraints, getPartitionKeyList, getPropertyList, getTableConstraints, getTableName, getWatermark, hasRegularColumnsOnly, isIfNotExists, isTemporary
accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getKind, getMonotonicity, isCountStar, isExpanded, operand, operandCount, setOperand, validate
public SqlCreateTableAs(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, org.apache.calcite.sql.SqlNode asQuery, 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 org.apache.calcite.sql.SqlNode getAsQuery()
public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)
unparse
in class SqlCreateTable
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.