Package org.apache.flink.sql.parser.ddl
Class SqlCreateTableAs
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.SqlCreateTableAs
- All Implemented Interfaces:
Cloneable,ExtendedSqlNode
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;
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.flink.sql.parser.ddl.SqlCreateTable
SqlCreateTable.TableCreationContext -
Field Summary
FieldsFields inherited from class org.apache.calcite.sql.SqlCreate
ifNotExistsFields inherited from class org.apache.calcite.sql.SqlDdl
DDL_OPERATORFields inherited from class org.apache.calcite.sql.SqlNode
EMPTY_ARRAY, pos -
Constructor Summary
ConstructorsConstructorDescriptionSqlCreateTableAs(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) -
Method Summary
Methods inherited from class org.apache.flink.sql.parser.ddl.SqlCreateTable
fullTableName, getColumnList, getColumnSqlString, getComment, getDistribution, getFullConstraints, getPartitionKeyList, getPropertyList, getTableConstraints, getTableName, getWatermark, hasRegularColumnsOnly, isIfNotExists, isTemporaryMethods inherited from class org.apache.calcite.sql.SqlCreate
getReplace, setReplaceMethods 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
-
Field Details
-
OPERATOR
public static final org.apache.calcite.sql.SqlSpecialOperator OPERATOR
-
-
Constructor Details
-
SqlCreateTableAs
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, 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)
-
-
Method Details
-
getOperator
@Nonnull public org.apache.calcite.sql.SqlOperator getOperator()- Overrides:
getOperatorin classSqlCreateTable
-
getOperandList
- Overrides:
getOperandListin classSqlCreateTable
-
validate
- Specified by:
validatein interfaceExtendedSqlNode- Overrides:
validatein classSqlCreateTable- Throws:
SqlValidateException
-
getAsQuery
public org.apache.calcite.sql.SqlNode getAsQuery() -
isSchemaWithColumnsIdentifiersOnly
public boolean isSchemaWithColumnsIdentifiersOnly() -
unparse
public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec) - Overrides:
unparsein classSqlCreateTable
-