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
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected final List<SQLSelectOrderByItem>
protected ClusteringType
protected SQLExpr
protected Boolean
protected boolean
protected SQLExpr
protected boolean
protected boolean
protected boolean
protected SQLExprTableSource
protected SQLExprTableSource
protected SQLPartitionBy
protected SQLExpr
protected Boolean
protected boolean
protected boolean
protected final List<SQLColumnDefinition>
protected SQLPartitionBy
protected boolean
protected SQLExternalRecordFormat
protected SQLSelect
protected int
protected boolean
protected final List<SQLSelectOrderByItem>
protected SQLExpr
protected List<SQLTableElement>
protected final List<SQLAssignItem>
protected SQLExprTableSource
protected SQLName
protected final List<SQLAssignItem>
protected SQLCreateTableStatement.Type
Fields inherited from class com.alibaba.druid.sql.ast.SQLStatementImpl
afterSemi, dbType, headHints
Fields inherited from class com.alibaba.druid.sql.ast.SQLObjectImpl
attributes, hint, parent, sourceColumn, sourceLine
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
void
addBodyBeforeComment
(List<String> comments) void
void
addColumn
(SQLColumnDefinition column) void
void
void
void
void
addTblProperty
(String name, SQLExpr value) protected boolean
alterApply
(SQLAlterTableItem item) protected boolean
apply
(SQLAlterTableAddIndex item) boolean
apply
(SQLAlterTableStatement alter) boolean
boolean
clone()
void
protected int
columnIndexOf
(SQLName column) boolean
boolean
containsDuplicateColumnNames
(boolean throwException) findColumn
(long columName_hash) findColumn
(String columName) findUnique
(String columnName) void
forEachColumn
(Consumer<SQLColumnDefinition> columnConsumer) int
getColumnNames
(boolean normalized) getLike()
getName()
getOptionValue
(String name) int
getTblProperty
(String name) getTblPropertyValue
(String name) getType()
boolean
boolean
boolean
boolean
boolean
boolean
isIgnore()
boolean
only for show columnsboolean
boolean
isOnlyPrimaryKey
(long columnNameHash) boolean
isPrimaryColumn
(long columnNameHash) boolean
isPrimaryColumn
(String columnName) boolean
isReferenced
(SQLName tableName) boolean
isReferenced
(String tableName) boolean
boolean
isSingle()
boolean
only for show columnsboolean
renameColumn
(String colummName, String newColumnName) void
setBuckets
(int buckets) void
setClusteringType
(ClusteringType clusteringType) void
setComment
(SQLExpr comment) void
setCompress
(Boolean compress) void
setDimension
(boolean dimension) void
void
setExternal
(boolean external) void
setIfNotExiists
(boolean ifNotExists) void
setIgnore
(boolean ignore) void
setInherits
(SQLExprTableSource inherits) void
void
setLike
(SQLExprTableSource like) void
setLocalPartitioning
(SQLPartitionBy localPartitioning) void
void
setLogging
(Boolean logging) void
void
void
setOnCommitPreserveRows
(boolean onCommitPreserveRows) void
setPartitioning
(SQLPartitionBy partitioning) void
setReplace
(boolean replace) void
void
void
void
setShards
(int shards) void
setSingle
(boolean single) void
void
setTableName
(String tableName) void
setTableSource
(SQLExprTableSource tableSource) void
void
void
simplify()
static void
sort
(List<SQLStatement> stmtList) toString()
Methods inherited from class com.alibaba.druid.sql.ast.SQLStatementImpl
getDbType, getHeadHintsDirect, isAfterSemi, setAfterSemi, setDbType, setHeadHints, toLowerCaseString, toParameterizedString, toString, toUnformattedString
Methods 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, setSourceLine
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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, setParent
Methods 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:
accept0
in classSQLStatementImpl
-
acceptChild
-
getComment
-
setComment
-
getName
-
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:
getChildren
in interfaceSQLStatement
- Overrides:
getChildren
in 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:
clone
in interfaceSQLObject
- Specified by:
clone
in interfaceSQLStatement
- Overrides:
clone
in classSQLStatementImpl
-
toString
- Specified by:
toString
in interfaceSQLStatement
- Overrides:
toString
in 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
-