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:
AntsparkCreateTableStatement,BlinkCreateTableStatement,ClickhouseCreateTableStatement,DB2CreateTableStatement,HiveCreateTableStatement,MySqlCreateTableStatement,OracleCreateTableStatement
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 booleanprotected SQLExprprotected booleanprotected booleanprotected booleanprotected SQLExprTableSourceprotected SQLExprTableSourceprotected SQLPartitionByprotected SQLExprprotected Booleanprotected booleanprotected booleanprotected final List<SQLColumnDefinition>protected SQLPartitionByprotected booleanprotected SQLExternalRecordFormatprotected SQLSelectprotected intprotected booleanprotected final List<SQLSelectOrderByItem>protected SQLExprprotected List<SQLTableElement>protected final List<SQLAssignItem>protected SQLExprTableSourceprotected SQLNameprotected final List<SQLAssignItem>protected SQLCreateTableStatement.TypeFields 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) protected booleanalterApply(SQLAlterTableItem item) protected booleanapply(SQLAlterTableAddIndex item) booleanapply(SQLAlterTableStatement alter) booleanbooleanclone()voidprotected intcolumnIndexOf(SQLName column) 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) intgetTblProperty(String name) getTblPropertyValue(String name) getType()booleanbooleanbooleanbooleanbooleanbooleanisIgnore()booleanonly for show columnsbooleanbooleanisOnlyPrimaryKey(long columnNameHash) booleanisPrimaryColumn(long columnNameHash) booleanisPrimaryColumn(String columnName) booleanisReferenced(SQLName tableName) booleanisReferenced(String tableName) booleanbooleanisSingle()booleanonly for show columnsbooleanrenameColumn(String colummName, String newColumnName) voidsetBuckets(int buckets) voidsetClusteringType(ClusteringType clusteringType) voidsetComment(SQLExpr comment) voidsetCompress(Boolean compress) voidsetDimension(boolean dimension) voidvoidsetExternal(boolean external) voidsetIfNotExiists(boolean ifNotExists) voidsetIgnore(boolean ignore) voidsetInherits(SQLExprTableSource inherits) voidvoidsetLike(SQLExprTableSource like) voidsetLocalPartitioning(SQLPartitionBy localPartitioning) voidvoidsetLogging(Boolean logging) voidvoidvoidsetOnCommitPreserveRows(boolean onCommitPreserveRows) voidsetPartitioning(SQLPartitionBy partitioning) voidsetReplace(boolean replace) voidvoidvoidvoidsetShards(int shards) voidsetSingle(boolean single) voidvoidsetTableName(String tableName) voidsetTableSource(SQLExprTableSource tableSource) voidvoidvoidsimplify()static voidsort(List<SQLStatement> stmtList) toString()Methods inherited from class com.alibaba.druid.sql.ast.SQLStatementImpl
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, computeDataType, containsAttribute, getAfterCommentsDirect, getAttribute, getAttributes, getAttributesDirect, getBeforeCommentsDirect, getHint, getParent, getSourceColumn, getSourceLine, hasAfterComment, hasBeforeComment, output, output, putAttribute, setHint, setParent, setSourceColumn, 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, hasAfterComment, hasBeforeComment, output, output, putAttribute, setParentMethods inherited from interface com.alibaba.druid.sql.ast.SQLStatement
getDbType, getHeadHintsDirect, isAfterSemi, setAfterSemi, setHeadHints, toLowerCaseString, toParameterizedString, toString
-
Field Details
-
ifNotExists
protected boolean ifNotExists -
type
-
tableSource
-
tableElementList
-
inherits
-
select
-
comment
-
like
-
compress
-
logging
-
tablespace
-
partitioning
-
localPartitioning
-
storedAs
-
location
-
onCommitPreserveRows
protected boolean onCommitPreserveRows -
onCommitDeleteRows
protected boolean onCommitDeleteRows -
external
protected boolean external -
rowFormat
-
partitionColumns
-
clusteringType
-
clusteredBy
-
sortedBy
-
buckets
protected int buckets -
shards
protected int shards -
tableOptions
-
tblProperties
-
replace
protected boolean replace -
ignore
protected boolean ignore -
single
protected boolean single -
dimension
protected boolean dimension -
engine
-
-
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
-
getType
-
setType
-
getTableElementList
-
getColumn
-
getColumnDefinitions
-
getColumnNames
-
getColumnComments
-
getPrimaryKeyNames
-
addColumn
-
addColumn
-
isIfNotExists
public boolean isIfNotExists() -
setIfNotExiists
public void setIfNotExiists(boolean ifNotExists) -
getInherits
-
setInherits
-
getSelect
-
setSelect
-
getLike
-
setLike
-
setLike
-
getCompress
-
setCompress
-
getLogging
-
setLogging
-
getTablespace
-
setTablespace
-
getPartitioning
-
getLocalPartitioning
-
setPartitioning
-
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
-
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
-
addTblProperty
-
getRowFormat
-
setRowFormat
-
isDimension
public boolean isDimension() -
setDimension
public void setDimension(boolean dimension) -
getLocation
-
setLocation
-
addOption
-
getOption
-
getTblProperty
-
getOptionValue
-
getTblPropertyValue
-
getOptionOrTblPropertyValue
-
getCatalog
-
containsDuplicateColumnNames
public boolean containsDuplicateColumnNames() -
containsDuplicateColumnNames
public boolean containsDuplicateColumnNames(boolean throwException) -
getEngine
-
setEngine
-
getDDLObjectType
- Specified by:
getDDLObjectTypein interfaceSQLDDLStatement
-