public class TCreateTableSqlStatement extends TCustomSqlStatement
TCustomSqlStatement.getTargetTable() returns the created table. getColumnList() returns columns created in the table.
getTableConstraints() returns table level constraints if any.
getSubQuery() returns select statement that generate data for this table.
CREATE TABLE dbo.Employee (EmployeeID int PRIMARY KEY CLUSTERED);
Table:dbo.Employee can be fetched from TCustomSqlStatement.getTargetTable() or the first element of TCustomSqlStatement.tables
getColumnList()
getTableConstraints()| Modifier and Type | Class and Description |
|---|---|
static class |
TCreateTableSqlStatement.TableSourceType |
TCustomSqlStatement.SqlNormalizationProfiledummytag, fromClause, fromSourceJoin, fromSourceTable, isctequery, isparsed, joins, parser, plsqlparser, relationAttributes, rootNode, semicolonended, sourcetokenlist, sqlstatementtype, stmtScope, tablesdbvendor, doubleLinkedTokenListToString, nodeActionAppend, nodeActionInsert, nodeActionRemove, nodeActionUnknown, nodeActionUpdate, nodeActionUpdateText, nodeChangeEndToken, nodeChangeStartToken| Constructor and Description |
|---|
TCreateTableSqlStatement(EDbVendor dbvendor) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(TParseTreeVisitor v)
Accept a visitor
|
void |
acceptChildren(TParseTreeVisitor v)
Accept a visitor to iterate this class and sub-nodes of this class
|
int |
doParseStatement(TCustomSqlStatement psql) |
TTable |
getAsTable()
Netezza, Teradata, as table name.
|
String |
getAwsSnsTopic() |
TObjectName |
getCloneSourceTable() |
TColumnDefinitionList |
getColumnList()
columns created in create table statement.
|
TConstant |
getExecuteCmd() |
TExecuteSqlStatement |
getExecutePreparedStatement() |
TExternalTableOption |
getExternalTableOption() |
String |
getExternalTableOption(String optionName)
sql server create external table with option.
|
List<String> |
getExternalTableOptionNames()
sql server create external table with options
|
String |
getFileFormatName() |
String |
getFileFormatType() |
TFlinkWithClause |
getFlinkWithClause()
Get the Flink WITH clause containing connector properties.
|
THiveRowFormat |
getHiveRowFormat()
Hive, impala table row format
|
THiveTableBuckets |
getHiveTableBuckets()
Hive, Impala table buckets
|
THiveTableFileFormat |
getHiveTableFileFormat()
Hive, Impala table file format
|
THiveTablePartition |
getHiveTablePartition()
Hive, Impala table partition
|
THiveTableProperties |
getHiveTableProperties()
Hive, Impala table properties
|
THiveTableSkewed |
getHiveTableSkewed()
Hive, Impala skewed by clause.
|
ArrayList<TIndexDefinition> |
getIndexDefinitions()
Teradata index definition
|
TInheritsClause |
getInheritsClause() |
TObjectName |
getLikeTableName()
Greenplum, table used in like clause.
|
ArrayList<TConstant> |
getLocationFiles() |
TPTNodeList<TMySQLCreateTableOption> |
getMySQLTableOptionList()
MySQL, option used in create table such as engine, auto_increment and etc.
|
TDummy |
getOnFilegroup() |
TPartitionBoundSpecSqlNode |
getPartitionBoundSpec() |
TExpression |
getPartitionByExpr()
Bigquery partition by expr
|
TObjectNameList |
getPartitionColumnList() |
ArrayList<TTeradataPeriodForClause> |
getPeriodForClauses()
Returns the list of Teradata PERIOD FOR clauses in this CREATE TABLE statement.
|
TPhysicalProperties |
getPhysicalProperties()
Oracle physical properties
|
TCustomSqlStatement |
getRefreshUsingStatement()
Snowflake custom incremental dynamic-table refresh logic.
|
String |
getRegex_pattern() |
TObjectName |
getRowTypeName()
Informix, typename used in of type clause.
|
TParseTreeNode |
getSharingClause() |
TStageLocation |
getStageLocation() |
TSelectSqlStatement |
getSubQuery()
Data of the created table is derived from this select statement.
|
TObjectName |
getSuperTableName()
Informix, table name used in the under clause.
|
TObjectName |
getTableComment()
Hive, Impala, comment of the table.
|
TConstraintList |
getTableConstraints()
table level constraints.
|
EnumSet<ETableKind> |
getTableKinds()
Type of this table
|
TObjectName |
getTableLocation()
The location of the table, where its files are:
's3://bucket/path/' in
LOCATION 's3://bucket/path/': Hive, Impala, Redshift, Spark SQL, Databricks, and Athena;
WITH (external_location = 's3://bucket/path/'), or location = ...: Presto, Trino, and
Athena.
|
TObjectName |
getTableName()
The first table in
TCustomSqlStatement.tables, this is the same table as TCustomSqlStatement.getTargetTable() |
ArrayList<TCreateTableOption> |
getTableOptions() |
TBaseTablePartition |
getTablePartition() |
TTableProperties |
getTableProperties() |
TCreateTableSqlStatement.TableSourceType |
getTableSourceType() |
TFlinkWatermarkClause |
getWatermarkClause()
Returns the first Flink WATERMARK clause in this CREATE TABLE statement.
|
ArrayList<TFlinkWatermarkClause> |
getWatermarkClauses()
Returns the list of Flink WATERMARK clauses in this CREATE TABLE statement.
|
boolean |
isExternal()
Hive, Impala,Netezza,snowflake whether it is an external table
|
boolean |
isExternalTable()
Deprecated.
As of v1.9.7.2 , replace by
isExternal()
Netezza, whether it is a external table |
boolean |
isIfNotExists()
Hive, Impala, if not exists clause
|
boolean |
isReadable() |
boolean |
isUsingTemplate()
Snowflake: whether this table is created with
{@code CREATE TABLE ...
|
boolean |
isWebTable() |
boolean |
isWritable() |
void |
setAsTable(TTable asTable) |
void |
setAwsSnsTopic(String awsSnsTopic) |
void |
setColumnList(TColumnDefinitionList columnList) |
void |
setExecutePreparedStatement(TExecuteSqlStatement executePreparedStatement) |
void |
setExternal(boolean external) |
void |
setExternalTable(boolean externalTable) |
void |
setFileFormatName(String fileFormatName) |
void |
setFileFormatType(String fileFormatType) |
void |
setFlinkWithClause(TFlinkWithClause flinkWithClause)
Set the Flink WITH clause.
|
void |
setHiveRowFormat(THiveRowFormat hiveRowFormat) |
void |
setHiveTableBuckets(THiveTableBuckets hiveTableBuckets) |
void |
setHiveTableFileFormat(THiveTableFileFormat hiveTableFileFormat) |
void |
setHiveTablePartition(THiveTablePartition hiveTablePartition) |
void |
setHiveTableProperties(THiveTableProperties hiveTableProperties) |
void |
setHiveTableSkewed(THiveTableSkewed hiveTableSkewed) |
void |
setIfNotExists(boolean ifNotExists) |
void |
setIndexDefinitions(ArrayList<TIndexDefinition> indexDefinitions) |
void |
setLikeTableName(TObjectName likeTableName) |
void |
setLocationFiles(ArrayList<TConstant> locationFiles) |
void |
setMySQLTableOptionList(TPTNodeList<TMySQLCreateTableOption> mySQLTableOptionList) |
void |
setOnFilegroup(TDummy onFilegroup) |
void |
setPartitionBoundSpec(TPartitionBoundSpecSqlNode partitionBoundSpec) |
void |
setPartitionByExpr(TExpression partitionByExpr) |
void |
setPartitionColumnList(TObjectNameList partitionColumnList) |
void |
setRegex_pattern(String regex_pattern) |
void |
setRowTypeName(TObjectName rowTypeName) |
void |
setStageLocation(TStageLocation stageLocation) |
void |
setSubQuery(TSelectSqlStatement subQuery) |
void |
setSuperTableName(TObjectName superTableName) |
void |
setTableComment(TObjectName tableComment) |
void |
setTableConstraints(TConstraintList tableConstraints) |
void |
setTableKinds(EnumSet<ETableKind> tableKinds) |
void |
setTableLocation(TObjectName tableLocation) |
void |
setTableName(TObjectName tableName) |
void |
setTableOptions(ArrayList<TCreateTableOption> tableOptions) |
void |
setTableProperties(TTableProperties tableProperties) |
addToTables, addWhereClause, analyzeFromTable, analyzeFromTable, analyzeJoin, analyzeTablename, analyzeTableOrJoin, asCanonical, checkNonQualifiedColumnReferenceInSubQueryOfUplevelStmt, clearError, computeSqlHash, dochecksyntax, findTable, fireOnMetaDatabaseTableColumn, getAncestorStmt, getAttributes, getColumnsInTable, getColumnsInTable, getCteIncludeThisStmt, getCteList, getDaxFunctionStack, getEndlabelName, getErrorCount, getErrormessage, getExpandedResultColumns, getFirstPhysicalTable, getFrameStack, getFromClause, getFromSourceJoin, getFromSourceTable, getGlobalScope, getIndexColumns, getJoins, getLabelName, getOrphanColumns, getOutputClause, getParentObjectName, getParentStmt, getQueryId, getRelationName, getRelations, getResultColumnList, getReturningClause, getSqlEnv, getSqlHash, getSqlHash, getStatements, getStmtScope, getSymbolTable, getSyntaxErrors, getSyntaxHints, getTables, getTargetTable, getTokenList, getTopClause, getTopStatement, getUsingVariableList, getVariableStack, getWhereClause, isathenaplsql, isBigQueryplsql, isdatabricksplsql, isGaussDBStoredProcedure, isgreeplumplsql, isMySQLDialect, isMySQLDialect, isnzplsql, isoracleplsql, isOraclePseudoColumnReference, isOracleSequencePseudoColumnReference, ispgplsql, isprestoplsql, issnowflakeplsql, isTableACTE, isverticaplsql, linkColumnReferenceToTable, linkColumnToTable, linkToFirstTable, locateVariableOrParameter, locateVariableOrParameter, OracleStatementCanBeSeparatedByBeginEndPair, parseerrormessagehandle, parsestatement, parsestatement, searchCTEList, searchDaxVariableInStack, searchFunctionInSQLEnv, setAlreadyAddToParent, setCteIncludeThisStmt, setCteList, setEndlabelName, setFrameStack, setFromClause, setLabelName, setOutputClause, setParentStmt, setParentStmtToNull, setQueryId, setResultColumnList, setReturningClause, setSqlHash, setStmtScope, setTargetTable, setTopClause, setUsingVariableList, setVariableStack, setWhereClause, size, toNormalizedSql, toScript, unbindCteTarget, VerticaStatementCanBeSeparatedByBeginEndPairaddAllMyTokensToTokenList, addToTokenChain, appendNewNode, calculateTokenCount, commentBlockAfter, commentBlockEndAfter, doAppendNewNode, doParse, fastSetString, getAnchorNode, getColumnNo, getCommentAfterNode, getCommentBeforeNode, getCommentBeforeNode, getCommentBeforeNode, getCompactString, getDummyTag, getEndToken, getEvaluateDatatype, getEvalValue, getGsqlparser, getLineNo, getLocation, getMd5, getNodeStatus, getNodeType, getPlainText, getStartToken, getTokenCount, hasNext, init, init, init, init, init, init, init, init, init, init, insertAfterAToken, insertNewNodeBeforeMe, isChanged, isTokensInChain, next, refreshAllNodesTokenCount, remove, removeAllMyTokensFromTokenList, removeTokens, removeTokensBetweenNodes, removeTokensBetweenToken, replaceWithNewNode, resetIterator, setAnchorNode, setChanged, setDummyTag, setEndToken, setEndToken, setEndToken, setEndToken, setEndToken, setEndTokenDirectly, setEvaluateDatatype, setEvalValue, setGsqlparser, setIncludingComment, setLocation, setNewSubNode, setNodeStatus, setNodeType, setParent, setPlainText, setStartToken, setStartToken, setStartToken, setStartToken, setStartTokenDirectly, setString, setString2, subNodeInNode, toString, toString2clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachRemainingpublic TCreateTableSqlStatement(EDbVendor dbvendor)
public TInheritsClause getInheritsClause()
public TBaseTablePartition getTablePartition()
public void setPartitionBoundSpec(TPartitionBoundSpecSqlNode partitionBoundSpec)
public TPartitionBoundSpecSqlNode getPartitionBoundSpec()
public TTableProperties getTableProperties()
public void setTableProperties(TTableProperties tableProperties)
public TParseTreeNode getSharingClause()
public List<String> getExternalTableOptionNames()
public String getExternalTableOption(String optionName)
optionName - public TCreateTableSqlStatement.TableSourceType getTableSourceType()
public TObjectName getCloneSourceTable()
public TExternalTableOption getExternalTableOption()
public void setPartitionByExpr(TExpression partitionByExpr)
public TExpression getPartitionByExpr()
public void setAwsSnsTopic(String awsSnsTopic)
public String getAwsSnsTopic()
public void setPartitionColumnList(TObjectNameList partitionColumnList)
public TObjectNameList getPartitionColumnList()
public void setFileFormatName(String fileFormatName)
public void setFileFormatType(String fileFormatType)
public String getFileFormatName()
public String getFileFormatType()
public void setRegex_pattern(String regex_pattern)
public String getRegex_pattern()
public void setStageLocation(TStageLocation stageLocation)
public TStageLocation getStageLocation()
public void setTableOptions(ArrayList<TCreateTableOption> tableOptions)
public ArrayList<TCreateTableOption> getTableOptions()
public void setOnFilegroup(TDummy onFilegroup)
public TDummy getOnFilegroup()
public TPhysicalProperties getPhysicalProperties()
public void setTableKinds(EnumSet<ETableKind> tableKinds)
public EnumSet<ETableKind> getTableKinds()
public TTable getAsTable()
public boolean isExternalTable()
isExternal()
public ArrayList<TIndexDefinition> getIndexDefinitions()
UNIQUE PRIMARY INDEX (storeid, productid, salesdate)
public ArrayList<TTeradataPeriodForClause> getPeriodForClauses()
public ArrayList<TFlinkWatermarkClause> getWatermarkClauses()
public TFlinkWatermarkClause getWatermarkClause()
public TFlinkWithClause getFlinkWithClause()
Flink SQL uses the WITH clause to specify connector properties:
CREATE TABLE my_table ( id BIGINT, name STRING ) WITH ( 'connector' = 'kafka', 'topic' = 'my-topic', 'properties.bootstrap.servers' = 'localhost:9092', 'format' = 'json' );
public void setFlinkWithClause(TFlinkWithClause flinkWithClause)
flinkWithClause - the Flink WITH clausepublic boolean isExternal()
public boolean isUsingTemplate()
CREATE TABLE ... USING TEMPLATE <query>, where the query result
(typically over INFER_SCHEMA) derives the column definitions.public THiveRowFormat getHiveRowFormat()
public THiveTableBuckets getHiveTableBuckets()
public THiveTableFileFormat getHiveTableFileFormat()
public THiveTablePartition getHiveTablePartition()
public THiveTableProperties getHiveTableProperties()
public THiveTableSkewed getHiveTableSkewed()
public boolean isIfNotExists()
public TObjectName getLikeTableName()
public TObjectName getTableComment()
public TObjectName getTableLocation()
's3://bucket/path/' in
LOCATION 's3://bucket/path/': Hive, Impala, Redshift, Spark SQL, Databricks, and Athena;WITH (external_location = 's3://bucket/path/'), or location = ...: Presto, Trino, and
Athena.public TObjectName getRowTypeName()
public TObjectName getSuperTableName()
public TSelectSqlStatement getSubQuery()
TSelectSqlStatement used in create table.public TCustomSqlStatement getRefreshUsingStatement()
public TExecuteSqlStatement getExecutePreparedStatement()
public TPTNodeList<TMySQLCreateTableOption> getMySQLTableOptionList()
public TObjectName getTableName()
TCustomSqlStatement.tables, this is the same table as TCustomSqlStatement.getTargetTable()TCustomSqlStatement.tables, or null when the statement was
only partially parsed and no table was recorded (e.g. a syntax
error before the table name). Callers treat a missing table name
as optional, so returning null is preferred over throwing.public boolean isWebTable()
public boolean isReadable()
public boolean isWritable()
public TConstant getExecuteCmd()
public void setLocationFiles(ArrayList<TConstant> locationFiles)
public ArrayList<TConstant> getLocationFiles()
public int doParseStatement(TCustomSqlStatement psql)
doParseStatement in class TCustomSqlStatementpublic TConstraintList getTableConstraints()
public TColumnDefinitionList getColumnList()
public void accept(TParseTreeVisitor v)
TParseTreeNodeaccept in interface Visitableaccept in class TParseTreeNodev - visitor is a descendant class of TParseTreeVisitorpublic void acceptChildren(TParseTreeVisitor v)
TParseTreeNodeacceptChildren in interface VisitableacceptChildren in class TParseTreeNodev - visitor is a descendant class of TParseTreeVisitorpublic void setColumnList(TColumnDefinitionList columnList)
public void setAsTable(TTable asTable)
public void setExternalTable(boolean externalTable)
public void setIndexDefinitions(ArrayList<TIndexDefinition> indexDefinitions)
public void setExternal(boolean external)
public void setIfNotExists(boolean ifNotExists)
public void setTableLocation(TObjectName tableLocation)
public void setTableComment(TObjectName tableComment)
public void setHiveTableProperties(THiveTableProperties hiveTableProperties)
public void setHiveTablePartition(THiveTablePartition hiveTablePartition)
public void setHiveTableBuckets(THiveTableBuckets hiveTableBuckets)
public void setHiveTableSkewed(THiveTableSkewed hiveTableSkewed)
public void setHiveRowFormat(THiveRowFormat hiveRowFormat)
public void setHiveTableFileFormat(THiveTableFileFormat hiveTableFileFormat)
public void setLikeTableName(TObjectName likeTableName)
public void setRowTypeName(TObjectName rowTypeName)
public void setSuperTableName(TObjectName superTableName)
public void setSubQuery(TSelectSqlStatement subQuery)
public void setExecutePreparedStatement(TExecuteSqlStatement executePreparedStatement)
public void setMySQLTableOptionList(TPTNodeList<TMySQLCreateTableOption> mySQLTableOptionList)
public void setTableName(TObjectName tableName)
public void setTableConstraints(TConstraintList tableConstraints)