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.SqlCreateObject
-
- org.apache.flink.sql.parser.ddl.table.SqlCreateTable
-
- All Implemented Interfaces:
Cloneable,ExtendedSqlNode
- Direct Known Subclasses:
SqlCreateTableAs,SqlCreateTableLike,SqlReplaceTableAs
public class SqlCreateTable extends SqlCreateObject implements ExtendedSqlNode
CREATE TABLE DDL sql call.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.calcite.sql.SqlNodeListpartitionKeyList-
Fields inherited from class org.apache.flink.sql.parser.ddl.SqlCreateObject
comment, name, properties
-
-
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)protectedSqlCreateTable(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, boolean replace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.calcite.sql.SqlNodeListgetColumnList()StringgetColumnSqlString()Returns the projection format of the DDL columns(including computed columns). i.e. the following DDL:SqlDistributiongetDistribution()List<SqlTableConstraint>getFullConstraints()Returns the column constraints plus the table constraints.List<org.apache.calcite.sql.SqlNode>getOperandList()List<String>getPartitionKeyList()protected StringgetScope()The scope will be used in unparse.List<SqlTableConstraint>getTableConstraints()Optional<SqlWatermark>getWatermark()voidunparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)voidvalidate()-
Methods inherited from class org.apache.flink.sql.parser.ddl.SqlCreateObject
getComment, getFullName, getName, getProperties, isIfNotExists, isTemporary, unparseCreateIfNotExists
-
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, boolean replace)
-
-
Method Detail
-
getOperandList
@Nonnull public List<org.apache.calcite.sql.SqlNode> getOperandList()
- Specified by:
getOperandListin classorg.apache.calcite.sql.SqlCall
-
getColumnList
public org.apache.calcite.sql.SqlNodeList getColumnList()
-
getDistribution
public final SqlDistribution getDistribution()
-
getTableConstraints
public List<SqlTableConstraint> getTableConstraints()
-
getWatermark
public Optional<SqlWatermark> getWatermark()
-
getScope
protected String getScope()
Description copied from class:SqlCreateObjectThe scope will be used in unparse.- Specified by:
getScopein classSqlCreateObject
-
validate
public void validate() throws SqlValidateException- Specified by:
validatein interfaceExtendedSqlNode- Throws:
SqlValidateException
-
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:
unparsein classSqlCreateObject
-
-