public class SqlReplaceTableAs extends org.apache.calcite.sql.SqlCreate implements ExtendedSqlNode
SqlNode
to describe the [CREATE OR] REPLACE TABLE AS (RTAS) syntax. The RTAS would create
a pipeline to compute the result of the given query and create or replace the derived table.
Notes: REPLACE TABLE AS: the derived table must exist. CREATE OR REPLACE TABLE AS: create the derived table if it does not exist, otherwise replace it.
Example:
CREATE TABLE base_table (
id BIGINT,
name STRING,
time TIMESTAMP,
PRIMARY KEY(id)
) WITH (
‘connector’ = ‘kafka’,
‘connector.starting-offset’: ‘12345’,
‘format’ = ‘json’
)
CREATE OR REPLACE TABLE derived_table
WITH (
'connector' = 'jdbc',
'url' = 'http://localhost:10000',
'table-name' = 'syncedTable'
)
AS SELECT * FROM base_table;
Modifier and Type | Field and Description |
---|---|
static org.apache.calcite.sql.SqlSpecialOperator |
CREATE_OR_REPLACE_OPERATOR |
static org.apache.calcite.sql.SqlSpecialOperator |
REPLACE_OPERATOR |
Constructor and Description |
---|
SqlReplaceTableAs(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,
org.apache.calcite.sql.SqlNode asQuery,
boolean isTemporary,
boolean ifNotExists,
boolean isCreateOrReplace) |
Modifier and Type | Method and Description |
---|---|
String[] |
fullTableName() |
org.apache.calcite.sql.SqlNode |
getAsQuery() |
org.apache.calcite.sql.SqlNodeList |
getColumnList() |
Optional<org.apache.calcite.sql.SqlCharStringLiteral> |
getComment() |
SqlDistribution |
getDistribution() |
List<SqlTableConstraint> |
getFullConstraints()
Returns the column constraints plus the table constraints.
|
List<org.apache.calcite.sql.SqlNode> |
getOperandList() |
org.apache.calcite.sql.SqlNodeList |
getPartitionKeyList() |
org.apache.calcite.sql.SqlNodeList |
getPropertyList() |
List<SqlTableConstraint> |
getTableConstraints() |
org.apache.calcite.sql.SqlIdentifier |
getTableName() |
Optional<SqlWatermark> |
getWatermark() |
boolean |
isCreateOrReplace() |
boolean |
isIfNotExists() |
boolean |
isTemporary() |
void |
unparse(org.apache.calcite.sql.SqlWriter writer,
int leftPrec,
int rightPrec) |
void |
validate() |
accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getKind, getMonotonicity, isCountStar, isExpanded, operand, operandCount, setOperand, validate
public static final org.apache.calcite.sql.SqlSpecialOperator REPLACE_OPERATOR
public static final org.apache.calcite.sql.SqlSpecialOperator CREATE_OR_REPLACE_OPERATOR
public SqlReplaceTableAs(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, org.apache.calcite.sql.SqlNode asQuery, boolean isTemporary, boolean ifNotExists, boolean isCreateOrReplace)
public SqlDistribution getDistribution()
@Nonnull public List<org.apache.calcite.sql.SqlNode> getOperandList()
getOperandList
in class org.apache.calcite.sql.SqlCall
public void validate() throws SqlValidateException
validate
in interface ExtendedSqlNode
SqlValidateException
public org.apache.calcite.sql.SqlNode getAsQuery()
public boolean isCreateOrReplace()
public org.apache.calcite.sql.SqlIdentifier getTableName()
public org.apache.calcite.sql.SqlNodeList getColumnList()
public org.apache.calcite.sql.SqlNodeList getPropertyList()
public org.apache.calcite.sql.SqlNodeList getPartitionKeyList()
public List<SqlTableConstraint> getTableConstraints()
public Optional<SqlWatermark> getWatermark()
public Optional<org.apache.calcite.sql.SqlCharStringLiteral> getComment()
public boolean isIfNotExists()
public boolean isTemporary()
public List<SqlTableConstraint> getFullConstraints()
public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)
unparse
in class org.apache.calcite.sql.SqlCall
public String[] fullTableName()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.