Class 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
  • Field Details

  • Constructor Details

    • SQLCreateTableStatement

      public SQLCreateTableStatement()
    • SQLCreateTableStatement

      public SQLCreateTableStatement(DbType dbType)
  • Method Details

    • accept0

      protected void accept0(SQLASTVisitor v)
      Overrides:
      accept0 in class SQLStatementImpl
    • acceptChild

      protected void acceptChild(SQLASTVisitor v)
    • getComment

      public SQLExpr getComment()
    • setComment

      public void setComment(SQLExpr comment)
    • getName

      public SQLName getName()
    • getTableName

      public String getTableName()
    • getSchema

      public String getSchema()
    • setSchema

      public void setSchema(String name)
    • setName

      public void setName(SQLName name)
    • setName

      public void setName(String name)
    • getTableSource

      public SQLExprTableSource getTableSource()
    • setTableSource

      public void setTableSource(SQLExprTableSource tableSource)
    • setTableName

      public void setTableName(String tableName)
    • getType

      public SQLCreateTableStatement.Type getType()
    • setType

      public void setType(SQLCreateTableStatement.Type type)
    • getTableElementList

      public List<SQLTableElement> getTableElementList()
    • getColumn

      public SQLColumnDefinition getColumn(String columnName)
    • getColumnDefinitions

      public List<SQLColumnDefinition> getColumnDefinitions()
    • getColumnNames

      public List<String> getColumnNames(boolean normalized)
    • getColumnComments

      public List<String> getColumnComments()
    • getPrimaryKeyNames

      public List<String> getPrimaryKeyNames()
    • addColumn

      public void addColumn(String columnName, String dataType)
    • addColumn

      public void addColumn(SQLColumnDefinition column)
    • isIfNotExists

      public boolean isIfNotExists()
    • setIfNotExiists

      public void setIfNotExiists(boolean ifNotExists)
    • getInherits

      public SQLExprTableSource getInherits()
    • setInherits

      public void setInherits(SQLExprTableSource inherits)
    • getSelect

      public SQLSelect getSelect()
    • setSelect

      public void setSelect(SQLSelect select)
    • getLike

      public SQLExprTableSource getLike()
    • setLike

      public void setLike(SQLName like)
    • setLike

      public void setLike(SQLExprTableSource like)
    • getCompress

      public Boolean getCompress()
    • setCompress

      public void setCompress(Boolean compress)
    • getLogging

      public Boolean getLogging()
    • setLogging

      public void setLogging(Boolean logging)
    • getTablespace

      public SQLName getTablespace()
    • setTablespace

      public void setTablespace(SQLName x)
    • getPartitioning

      public SQLPartitionBy getPartitioning()
    • getLocalPartitioning

      public SQLPartitionBy getLocalPartitioning()
    • setPartitioning

      public void setPartitioning(SQLPartitionBy partitioning)
    • setLocalPartitioning

      public void setLocalPartitioning(SQLPartitionBy localPartitioning)
    • getChildren

      public List<SQLObject> getChildren()
      Specified by:
      getChildren in interface SQLStatement
      Overrides:
      getChildren in class SQLStatementImpl
    • addBodyBeforeComment

      public void addBodyBeforeComment(List<String> comments)
    • getBodyBeforeCommentsDirect

      public List<String> getBodyBeforeCommentsDirect()
    • hasBodyBeforeComment

      public boolean hasBodyBeforeComment()
    • computeName

      public String computeName()
    • findColumn

      public SQLColumnDefinition findColumn(String columName)
    • findColumn

      public SQLColumnDefinition findColumn(long columName_hash)
    • isPrimaryColumn

      public boolean isPrimaryColumn(String columnName)
    • isPrimaryColumn

      public boolean isPrimaryColumn(long columnNameHash)
    • isOnlyPrimaryKey

      public boolean isOnlyPrimaryKey(long columnNameHash)
    • isMUL

      public boolean isMUL(String columnName)
      only for show columns
    • isUNI

      public boolean isUNI(String columnName)
      only for show columns
    • findUnique

      public MySqlUnique findUnique(String columnName)
    • findIndex

      public SQLTableElement findIndex(String columnName)
    • forEachColumn

      public void forEachColumn(Consumer<SQLColumnDefinition> columnConsumer)
    • findPrimaryKey

      public SQLPrimaryKey findPrimaryKey()
    • findForeignKey

      public List<SQLForeignKeyConstraint> findForeignKey()
    • hashForeignKey

      public boolean hashForeignKey()
    • isReferenced

      public boolean isReferenced(SQLName tableName)
    • isReferenced

      public boolean isReferenced(String tableName)
    • foreignKeyToAlterTable

      public SQLAlterTableStatement foreignKeyToAlterTable()
    • sort

      public static void sort(List<SQLStatement> stmtList)
    • simplify

      public void simplify()
    • apply

      public boolean apply(SQLDropIndexStatement x)
    • apply

      public boolean apply(SQLCommentStatement x)
    • apply

      public boolean apply(SQLAlterTableStatement alter)
    • alterApply

      protected boolean alterApply(SQLAlterTableItem item)
    • renameColumn

      public boolean renameColumn(String colummName, String newColumnName)
    • apply

      protected boolean apply(SQLAlterTableAddIndex item)
    • columnIndexOf

      protected int columnIndexOf(SQLName column)
    • cloneTo

      public void cloneTo(SQLCreateTableStatement x)
    • 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

      public SQLExpr getStoredAs()
    • setStoredAs

      public void setStoredAs(SQLExpr x)
    • clone

      public SQLCreateTableStatement clone()
      Specified by:
      clone in interface SQLObject
      Specified by:
      clone in interface SQLStatement
      Overrides:
      clone in class SQLStatementImpl
    • toString

      public String toString()
      Specified by:
      toString in interface SQLStatement
      Overrides:
      toString in class SQLStatementImpl
    • isOnCommitPreserveRows

      public boolean isOnCommitPreserveRows()
    • setOnCommitPreserveRows

      public void setOnCommitPreserveRows(boolean onCommitPreserveRows)
    • isExternal

      public boolean isExternal()
    • setExternal

      public void setExternal(boolean external)
    • getClusteringType

      public ClusteringType getClusteringType()
    • setClusteringType

      public void setClusteringType(ClusteringType clusteringType)
    • getClusteredBy

      public List<SQLSelectOrderByItem> getClusteredBy()
    • addClusteredByItem

      public void addClusteredByItem(SQLSelectOrderByItem item)
    • getSortedBy

      public List<SQLSelectOrderByItem> getSortedBy()
    • addSortedByItem

      public void addSortedByItem(SQLSelectOrderByItem item)
    • getBuckets

      public int getBuckets()
    • setBuckets

      public void setBuckets(int buckets)
    • getShards

      public int getShards()
    • setShards

      public void setShards(int shards)
    • getPartitionColumns

      public List<SQLColumnDefinition> getPartitionColumns()
    • addPartitionColumn

      public void addPartitionColumn(SQLColumnDefinition column)
    • getTableOptions

      public List<SQLAssignItem> getTableOptions()
    • getTblProperties

      public List<SQLAssignItem> getTblProperties()
    • addTblProperty

      public void addTblProperty(String name, SQLExpr value)
    • getRowFormat

      public SQLExternalRecordFormat getRowFormat()
    • setRowFormat

      public void setRowFormat(SQLExternalRecordFormat x)
    • isDimension

      public boolean isDimension()
    • setDimension

      public void setDimension(boolean dimension)
    • getLocation

      public SQLExpr getLocation()
    • setLocation

      public void setLocation(SQLExpr x)
    • addOption

      public void addOption(String name, SQLExpr value)
    • getOption

      public SQLExpr getOption(String name)
    • getTblProperty

      public SQLExpr getTblProperty(String name)
    • getOptionValue

      public Object getOptionValue(String name)
    • getTblPropertyValue

      public Object getTblPropertyValue(String name)
    • getOptionOrTblPropertyValue

      public Object getOptionOrTblPropertyValue(String name)
    • getCatalog

      public String getCatalog()
    • containsDuplicateColumnNames

      public boolean containsDuplicateColumnNames()
    • containsDuplicateColumnNames

      public boolean containsDuplicateColumnNames(boolean throwException)
    • getEngine

      public SQLExpr getEngine()
    • setEngine

      public void setEngine(SQLExpr x)