Class SQLCreateTableStatement
java.lang.Object
com.alibaba.druid.sql.ast.SQLObjectImpl
com.alibaba.druid.sql.ast.SQLStatementImpl
com.alibaba.druid.sql.ast.statement.SQLCreateTableStatement
- All Implemented Interfaces:
SQLDbTypedObject,SQLObject,SQLStatement,SQLCreateStatement,SQLDDLStatement
- Direct Known Subclasses:
BigQueryCreateTableStatement,BlinkCreateTableStatement,CKCreateTableStatement,DB2CreateTableStatement,GaussDbCreateTableStatement,HiveCreateTableStatement,MySqlCreateTableStatement,OracleCreateTableStatement,PrestoCreateTableStatement,RedshiftCreateTableStatement,SparkCreateTableStatement,StarRocksCreateTableStatement,TDCreateTableStatement
public class SQLCreateTableStatement
extends SQLStatementImpl
implements SQLDDLStatement, SQLCreateStatement
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.alibaba.druid.sql.ast.statement.SQLDDLStatement
SQLDDLStatement.DDLObjectType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected final List<SQLSelectOrderByItem> protected ClusteringTypeprotected SQLExprprotected Booleanprotected intprotected booleanprotected SQLExprTableSourceprotected SQLExprprotected SQLExprTableSourceprotected SQLPartitionByprotected SQLExprprotected Booleanprotected booleanprotected booleanprotected SQLPartitionByprotected final List<SQLColumnDefinition> protected SQLPartitionOfprotected booleanprotected SQLExternalRecordFormatprotected SQLSelectprotected intprotected booleanprotected final List<SQLSelectOrderByItem> protected SQLExprprotected SQLExprprotected List<SQLTableElement> protected final List<SQLAssignItem> protected SQLExprTableSourceprotected SQLNameprotected SQLUniqueFields inherited from class com.alibaba.druid.sql.ast.SQLStatementImpl
afterSemi, dbType, headHintsFields inherited from class com.alibaba.druid.sql.ast.SQLObjectImpl
attributes, hint, parent, sourceColumn, sourceLine -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidvoidaddBodyBeforeComment(List<String> comments) voidvoidaddColumn(SQLColumnDefinition column) voidvoidvoidvoidvoidaddTblProperty(String name, SQLExpr value) Deprecated.protected booleanalterApply(SQLAlterTableItem item) protected booleanapply(SQLAlterTableAddIndex item) booleanapply(SQLAlterTableStatement alter) booleanbooleanclone()voidprotected intcolumnIndexOf(SQLName column) voidconfig(SQLCreateTableStatement.Feature feature) voidconfig(SQLCreateTableStatement.Feature feature, boolean state) booleanbooleancontainsDuplicateColumnNames(boolean throwException) findColumn(long columName_hash) findColumn(String columName) findUnique(String columnName) voidforEachColumn(Consumer<SQLColumnDefinition> columnConsumer) intgetColumnNames(boolean normalized) getLike()getName()getOptionValue(String name) intDeprecated.getTblProperty(String name) getTblPropertyValue(String name) booleanbooleanbooleanbooleanisEnabled(SQLCreateTableStatement.Feature feature) booleanbooleanbooleanisIgnore()booleanonly for show columnsbooleanbooleanisOnlyPrimaryKey(long columnNameHash) booleanisPrimaryColumn(long columnNameHash) booleanisPrimaryColumn(String columnName) booleanisReferenced(SQLName tableName) booleanisReferenced(String tableName) booleanbooleanisSingle()booleanbooleanonly for show columnsbooleanremoveOption(String name) booleanrenameColumn(String colummName, String newColumnName) voidsetBuckets(int buckets) voidsetClusteringType(ClusteringType clusteringType) voidsetComment(SQLExpr comment) voidsetCompress(Boolean compress) voidsetDimension(boolean dimension) voidsetExternal(boolean external) voidsetIfNotExists(boolean value) voidsetIgnore(boolean ignore) voidsetInherits(SQLExprTableSource inherits) voidvoidvoidsetLike(SQLExprTableSource like) voidsetLocalPartitioning(SQLPartitionBy localPartitioning) voidvoidsetLogging(Boolean logging) voidvoidvoidsetOnCommitPreserveRows(boolean onCommitPreserveRows) voidsetPartitionBy(SQLPartitionBy partitionBy) voidsetPartitionOf(SQLPartitionOf partitionOf) voidsetReplace(boolean replace) voidvoidvoidvoidsetShards(int shards) voidsetSingle(boolean single) voidvoidvoidsetTableName(String tableName) voidsetTableSource(SQLExprTableSource tableSource) voidvoidsetTemporary(boolean value) voidvoidsimplify()static voidsort(List<SQLStatement> stmtList) toString()Methods inherited from class com.alibaba.druid.sql.ast.SQLStatementImpl
cloneTo, getDbType, getHeadHintsDirect, isAfterSemi, setAfterSemi, setDbType, setHeadHints, toLowerCaseString, toParameterizedString, toString, toUnformattedStringMethods inherited from class com.alibaba.druid.sql.ast.SQLObjectImpl
accept, acceptChild, acceptChild, addAfterComment, addAfterComment, addBeforeComment, addBeforeComment, cloneTo, computeDataType, containsAttribute, getAfterCommentsDirect, getAttribute, getAttributes, getAttributesDirect, getBeforeCommentsDirect, getHint, getParent, getSourceColumn, getSourceLine, hasAfterComment, hasBeforeComment, output, putAttribute, setHint, setParent, setSource, setSourceLineMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.alibaba.druid.sql.ast.SQLObject
accept, addAfterComment, addAfterComment, addBeforeComment, addBeforeComment, containsAttribute, getAfterCommentsDirect, getAttribute, getAttributes, getAttributesDirect, getBeforeCommentsDirect, getParent, getSourceColumn, getSourceLine, hasAfterComment, hasBeforeComment, output, putAttribute, setParent, setSourceMethods inherited from interface com.alibaba.druid.sql.ast.SQLStatement
getDbType, getHeadHintsDirect, isAfterSemi, setAfterSemi, setHeadHints, toLowerCaseString, toParameterizedString, toString
-
Field Details
-
features
protected int features -
tableSource
-
tableElementList
-
inherits
-
select
-
comment
-
like
-
compress
-
logging
-
tablespace
-
partitionBy
-
partitionOf
-
localPartitioning
-
unique
-
storedAs
-
storedBy
-
location
-
onCommitPreserveRows
protected boolean onCommitPreserveRows -
onCommitDeleteRows
protected boolean onCommitDeleteRows -
rowFormat
-
partitionColumns
-
clusteringType
-
clusteredBy
-
sortedBy
-
buckets
protected int buckets -
shards
protected int shards -
tableOptions
-
replace
protected boolean replace -
ignore
protected boolean ignore -
single
protected boolean single -
lifeCycle
-
-
Constructor Details
-
SQLCreateTableStatement
public SQLCreateTableStatement() -
SQLCreateTableStatement
-
-
Method Details
-
accept0
- Overrides:
accept0in classSQLStatementImpl
-
acceptChild
-
getComment
-
setComment
-
getName
- Specified by:
getNamein interfaceSQLCreateStatement
-
getTableName
-
getSchema
-
setSchema
-
setName
-
setName
-
getTableSource
-
setTableSource
-
setTableName
-
config
-
isEnabled
-
config
-
isTemporary
public boolean isTemporary() -
setTemporary
public void setTemporary(boolean value) -
getTableElementList
-
getColumn
-
getColumnDefinitions
-
getColumnNames
-
getColumnComments
-
getPrimaryKeyNames
-
addColumn
-
addColumn
-
isIfNotExists
public boolean isIfNotExists() -
setIfNotExists
public void setIfNotExists(boolean value) -
getInherits
-
setInherits
-
getSelect
-
setSelect
-
getUnique
-
setUnique
-
getLike
-
setLike
-
setLike
-
getCompress
-
setCompress
-
getLogging
-
setLogging
-
getTablespace
-
setTablespace
-
getPartitioning
-
getLocalPartitioning
-
setPartitionBy
-
getPartitionOf
-
setPartitionOf
-
setLocalPartitioning
-
getChildren
- Specified by:
getChildrenin interfaceSQLStatement- Overrides:
getChildrenin classSQLStatementImpl
-
addBodyBeforeComment
-
getBodyBeforeCommentsDirect
-
hasBodyBeforeComment
public boolean hasBodyBeforeComment() -
computeName
-
findColumn
-
findColumn
-
isPrimaryColumn
-
isPrimaryColumn
public boolean isPrimaryColumn(long columnNameHash) -
isOnlyPrimaryKey
public boolean isOnlyPrimaryKey(long columnNameHash) -
isMUL
only for show columns -
isUNI
only for show columns -
findUnique
-
findIndex
-
forEachColumn
-
findPrimaryKey
-
findForeignKey
-
hashForeignKey
public boolean hashForeignKey() -
isReferenced
-
isReferenced
-
foreignKeyToAlterTable
-
sort
-
simplify
public void simplify() -
apply
-
apply
-
apply
-
alterApply
-
renameColumn
-
apply
-
columnIndexOf
-
cloneTo
-
isReplace
public boolean isReplace() -
setReplace
public void setReplace(boolean replace) -
isIgnore
public boolean isIgnore() -
setIgnore
public void setIgnore(boolean ignore) -
isSingle
public boolean isSingle() -
setSingle
public void setSingle(boolean single) -
getStoredAs
-
setStoredAs
-
getStoredBy
-
setStoredBy
-
clone
- Specified by:
clonein interfaceSQLObject- Specified by:
clonein interfaceSQLStatement- Overrides:
clonein classSQLStatementImpl
-
toString
- Specified by:
toStringin interfaceSQLStatement- Overrides:
toStringin classSQLStatementImpl
-
isOnCommitPreserveRows
public boolean isOnCommitPreserveRows() -
setOnCommitPreserveRows
public void setOnCommitPreserveRows(boolean onCommitPreserveRows) -
isExternal
public boolean isExternal() -
setExternal
public void setExternal(boolean external) -
getClusteringType
-
setClusteringType
-
getClusteredBy
-
addClusteredByItem
-
getSortedBy
-
addSortedByItem
-
getBuckets
public int getBuckets() -
setBuckets
public void setBuckets(int buckets) -
getShards
public int getShards() -
setShards
public void setShards(int shards) -
getPartitionColumns
-
addPartitionColumn
-
getTableOptions
-
getTblProperties
Deprecated. -
addTblProperty
Deprecated. -
getRowFormat
-
setRowFormat
-
isDimension
public boolean isDimension() -
setDimension
public void setDimension(boolean dimension) -
getLocation
-
setLocation
-
addOption
-
getOption
-
removeOption
-
getTblProperty
-
getOptionValue
-
getTblPropertyValue
-
getOptionOrTblPropertyValue
-
getCatalog
-
containsDuplicateColumnNames
public boolean containsDuplicateColumnNames() -
containsDuplicateColumnNames
public boolean containsDuplicateColumnNames(boolean throwException) -
getDDLObjectType
- Specified by:
getDDLObjectTypein interfaceSQLDDLStatement
-
getLifeCycle
-
setLifeCycle
-