Package org.apache.flink.sql.parser.ddl
Class SqlCreateTable
- 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
-
- All Implemented Interfaces:
Cloneable
,ExtendedSqlNode
- Direct Known Subclasses:
SqlCreateTableAs
,SqlCreateTableLike
public class SqlCreateTable extends org.apache.calcite.sql.SqlCreate implements ExtendedSqlNode
CREATE TABLE DDL sql call.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SqlCreateTable.TableCreationContext
Table creation context.
-
Field Summary
Fields Modifier and Type Field Description static org.apache.calcite.sql.SqlSpecialOperator
OPERATOR
-
Constructor Summary
Constructors Modifier Constructor Description SqlCreateTable(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, boolean isTemporary, boolean ifNotExists)
protected
SqlCreateTable(org.apache.calcite.sql.SqlSpecialOperator operator, 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, boolean isTemporary, boolean ifNotExists)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]
fullTableName()
org.apache.calcite.sql.SqlNodeList
getColumnList()
String
getColumnSqlString()
Returns the projection format of the DDL columns(including computed columns). i.e. the following DDL: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.SqlOperator
getOperator()
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
hasRegularColumnsOnly()
boolean
isIfNotExists()
boolean
isTemporary()
void
unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)
void
validate()
-
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
-
SqlCreateTable
public SqlCreateTable(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, boolean isTemporary, boolean ifNotExists)
-
SqlCreateTable
protected SqlCreateTable(org.apache.calcite.sql.SqlSpecialOperator operator, 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, @Nullable SqlDistribution distribution, org.apache.calcite.sql.SqlNodeList partitionKeyList, @Nullable SqlWatermark watermark, @Nullable org.apache.calcite.sql.SqlCharStringLiteral comment, boolean isTemporary, boolean ifNotExists)
-
-
Method Detail
-
getDistribution
public SqlDistribution getDistribution()
-
getOperator
@Nonnull public org.apache.calcite.sql.SqlOperator getOperator()
- Overrides:
getOperator
in classorg.apache.calcite.sql.SqlDdl
-
getOperandList
@Nonnull public List<org.apache.calcite.sql.SqlNode> getOperandList()
- Specified by:
getOperandList
in classorg.apache.calcite.sql.SqlCall
-
getTableName
public org.apache.calcite.sql.SqlIdentifier getTableName()
-
getColumnList
public org.apache.calcite.sql.SqlNodeList getColumnList()
-
getPropertyList
public org.apache.calcite.sql.SqlNodeList getPropertyList()
-
getPartitionKeyList
public org.apache.calcite.sql.SqlNodeList getPartitionKeyList()
-
getTableConstraints
public List<SqlTableConstraint> getTableConstraints()
-
getWatermark
public Optional<SqlWatermark> getWatermark()
-
getComment
public Optional<org.apache.calcite.sql.SqlCharStringLiteral> getComment()
-
isIfNotExists
public boolean isIfNotExists()
-
isTemporary
public boolean isTemporary()
-
validate
public void validate() throws SqlValidateException
- Specified by:
validate
in interfaceExtendedSqlNode
- Throws:
SqlValidateException
-
hasRegularColumnsOnly
public boolean hasRegularColumnsOnly()
-
getFullConstraints
public List<SqlTableConstraint> getFullConstraints()
Returns the column constraints plus the table constraints.
-
getColumnSqlString
public String getColumnSqlString()
Returns the projection format of the DDL columns(including computed columns). i.e. the following DDL:create table tbl1( col1 int, col2 varchar, col3 as to_timestamp(col2) ) with ( 'connector' = 'csv' )
is equivalent with query "col1, col2, to_timestamp(col2) as col3", caution that the "computed column" operands have been reversed.
-
unparse
public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)
- Overrides:
unparse
in classorg.apache.calcite.sql.SqlCall
-
fullTableName
public String[] fullTableName()
-
-