Package com.alibaba.druid.sql.parser
Class SQLStatementParser
java.lang.Object
com.alibaba.druid.sql.parser.SQLParser
com.alibaba.druid.sql.parser.SQLStatementParser
- Direct Known Subclasses:
BigQueryStatementParser,BlinkStatementParser,CKStatementParser,DB2StatementParser,H2StatementParser,HiveStatementParser,InformixStatementParser,MySqlStatementParser,OracleStatementParser,OracleUpdateParser,OscarStatementParser,PGSQLStatementParser,PhoenixStatementParser,PrestoStatementParser,SnowflakeStatementParser,SQLDDLParser,SQLServerStatementParser,StarRocksStatementParser,TDStatementParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Dateprotected Tokenprotected SQLExprParserprotected InsertColumnsCacheprotected Timestampprotected booleanprotected intprotected SchemaRepositoryprotected SQLSelectListCache -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSQLStatementParser(Lexer lexer, DbType dbType) SQLStatementParser(SQLExprParser exprParser) SQLStatementParser(String sql) SQLStatementParser(String sql, DbType dbType) SQLStatementParser(String sql, DbType dbType, SQLParserFeature... features) -
Method Summary
Modifier and TypeMethodDescriptionprotected SQLStatementprotected SQLStatementprotected SQLStatementprotected SQLStatementprotected SQLStatementprotected SQLStatementprotected SQLStatementalterRest(Lexer.SavePoint mark) protected SQLStatementprotected SQLAlterStatementprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected SQLAlterStatementprotected booleanprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected booleanprotected voidprotected voidprotected voidprotected SQLStatementprotected voidprotected voidprotected SQLStatementprotected voidprotected SQLStatementprotected SQLAlterTableStatementcreateSQLSelectParser(SQLExprParser exprParser) protected SQLStatementprotected SQLUpdateStatementprotected voidcreateViewAs(SQLCreateViewStatement createView) intbooleanbooleanprotected voidprotected voidparameters(List<SQLParameter> parameters, SQLObject parent) final SQLStatementprotected SQLAlterTableAlterColumnvoidvoidprotected SQLStatementprotected SQLAlterTableAddClusteringKeyprotected SQLAlterTableAddColumnprotected voidprotected booleanprotected SQLAlterTableDropPartitionparseAlterTableDropPartition(boolean ifExists) protected SQLAlterTableDropSubpartitionprotected SQLAlterTableItemprotected SQLAlterTableReplaceColumnprotected SQLStatementvoidparseAssignItems(List<? super SQLAssignItem> items, SQLObject parent) voidparseAssignItems(List<? super SQLAssignItem> items, SQLObject parent, boolean variant) protected SQLStatementprotected voidprotected SQLStatementprotected SQLStatementprotected SQLStatementvoidvoidparseCreateViewAfterName(SQLCreateViewStatement createView) voidparseCreateViewAtDataType(SQLColumnDefinition column, SQLName expr) protected SQLStatementprotected SQLDropStatementparseDropDatabaseOrSchema(boolean acceptDrop) protected SQLStatementprotected SQLDropFunctionStatementparseDropFunction(boolean acceptDrop) protected SQLStatementprotected SQLStatementprotected SQLDropProcedureStatementparseDropProcedure(boolean acceptDrop) protected SQLStatementprotected SQLStatementprotected SQLDropStatementparseDropSchema(boolean physical) protected SQLDropSequenceStatementparseDropSequence(boolean acceptDrop) protected SQLStatementprotected SQLDropTableStatementparseDropTable(boolean acceptDrop) protected SQLStatementprotected SQLDropTableSpaceStatementparseDropTablespace(boolean acceptDrop) protected SQLDropTriggerStatementparseDropTrigger(boolean acceptDrop) protected SQLDropViewStatementparseDropView(boolean acceptDrop) parseEnd()protected SQLErrorLoggingClausevoidvoidparseFor()protected FullTextTypevoidparseHints(List<SQLHint> hints) protected HiveInsertprotected HiveInsertStatementparseIf()protected voidparseIfElse(SQLIfStatement stmt) protected voidparseInsert0(SQLInsertInto insertStatement) protected voidparseInsert0(SQLInsertInto insertStatement, boolean acceptSubQuery) protected voidparseInsert0Hints(SQLInsertInto insertStatement, boolean isInsert) Impala dml support multiple place hint.protected voidparseInsertColumns(SQLInsertInto insert) protected SQLStatementParses the SQL OPEN statement and returns the corresponding SQLOpenStatement object.protected voidparsePrivilege(List<SQLPrivilegeItem> privileges, SQLObject parent) protected voidparserParameters(List<SQLParameter> parameters, SQLObject parent) parseSet()protected SQLShowColumnsStatementprotected SQLShowCreateTableStatementprotected SQLShowDatabasesStatementparseShowDatabases(boolean isPhysical) protected SQLShowTableGroupsStatementprotected SQLShowTablesStatementparseStatementList(SQLObject parent) voidparseStatementList(List<SQLStatement> statementList) voidparseStatementList(List<SQLStatement> statementList, int max) voidparseStatementList(List<SQLStatement> statementList, int max, SQLObject parent) booleanparseStatementListDialect(List<SQLStatement> statementList) protected voidparseUpdateSet(SQLUpdateStatement update) protected voidvoidparseUpdateStatementPartition(SQLUpdateStatement updateStatement) parseUse()protected SQLExprvoidparseValueClause(SQLInsertValueHandler valueHandler) protected voidparseValueClause(List<SQLInsertStatement.ValuesClause> valueClauseList, int columnSize, SQLObject parent) protected voidparseValueClause(List<SQLInsertStatement.ValuesClause> valueClauseList, List<SQLColumnDefinition> columnDefinitionList, int columnSize, SQLObject parent) protected voidparseValueClauseNative(List<SQLInsertStatement.ValuesClause> valueClauseList, List<SQLColumnDefinition> columnDefinitionList, int columnSize, SQLObject parent) protected SQLStatementprotected voidvoidsetKeepComments(boolean keepComments) voidsetParseCompleteValues(boolean parseCompleteValues) voidsetParseValuesSize(int parseValuesSize) voidsetRepository(SchemaRepository repository) voidsetSelectListCache(SQLSelectListCache selectListCache) Methods inherited from class com.alibaba.druid.sql.parser.SQLParser
accept, acceptIdentifier, acceptIdentifier, acceptInteger, alias, as, config, dialectFeatureEnabled, getDbType, getLexer, getTimeZone, identifierEquals, isEnabled, match, newCreateStatement, printError, setErrorEndPos, setTimeZone, tableAlias, tableAlias
-
Field Details
-
repository
-
exprParser
-
parseCompleteValues
protected boolean parseCompleteValues -
parseValuesSize
protected int parseValuesSize -
selectListCache
-
insertColumnsCache
-
now
-
currentDate
-
expectedNextToken
-
-
Constructor Details
-
SQLStatementParser
-
SQLStatementParser
-
SQLStatementParser
-
SQLStatementParser
-
SQLStatementParser
-
-
Method Details
-
isKeepComments
public boolean isKeepComments() -
setKeepComments
public void setKeepComments(boolean keepComments) -
getExprParser
-
getRepository
-
setRepository
-
parseStatementList
-
parseStatementList
-
parseStatementList
-
parseStatementList
-
parseStatementList
-
parseOptimize
-
parseCopy
-
parseFor
-
parseFlashback
-
parseDump
-
parseDrop
-
parseFullTextType
-
parseWhoami
-
parseDropOutline
-
parseRefresh
-
parseShowMaterializedView
-
parseDropMaterializedView
-
parseDropOfflineModel
-
parseDropCatalog
-
parseDropRole
-
parseDropTableGroup
-
parseDropServer
-
parseDropLogFileGroup
-
parseDropEvent
-
parseDropResource
-
alterTableSpace
-
alterProcedure
-
parseAlterFunction
-
parseKill
-
parseCase
-
parseIf
-
parseIfElse
-
parseWhile
-
parseDeclare
-
parseRepeat
-
parseLeave
-
parseCache
-
parsePurge
-
parseReturn
-
parseUpsert
-
parseRollback
-
parseCommit
-
parseShow
-
parseUse
-
parseUser
-
parseGrant
-
parsePrivilege
-
parseRevoke
-
parseSavePoint
-
parseReleaseSavePoint
-
parseAlter
-
alterRest
-
alterEvent
-
alterUser
-
alterView
-
createSQLAlterTableStatement
-
alterTable
-
alterTableBefore
-
alterTableAfterNameRest
-
alterTableAfterName
-
alterTableUnset
-
alterTableSorted
-
alterTableMerge
-
alterTableOwner
-
alterTableSetRest
-
alterTableSet
-
alterTableChangeOwner
-
alterTableSetSerdeProperties
-
alterTableSetTblProperties
-
alterTableWith
-
alterTableAlterComma
protected void alterTableAlterComma() -
alterTableAdd
-
alterTableAddIndex
-
alterTableAddConstraint
-
alterTableAddRestSpecific
-
alterTableAddRest
-
alterTableAddPartition
-
alterFullText
-
alterDatabase
-
alterSchema
-
parseAlterTableRename
-
parseAlterColumn
-
parseAlterDropRest
-
parseAlterDrop
-
parseAlterTableDropPartition
-
parseAlterTableDropSubpartition
-
parseRename
-
parseList
-
parseDropTable
-
parseDropSequence
-
parseDropTrigger
-
parseDropView
-
parseDropSchema
-
parseDropDatabaseOrSchema
-
parserParameters
-
parseDropFunction
-
parseDropTablespace
-
parseDropProcedure
-
parseTruncate
-
parseInsert
-
parseInsert0
-
parseInsert0Hints
Impala dml support multiple place hint. First hint_clause isInsert is true, second hint_clause isInsert is false. *************************************** [with_clause] INSERT [hint_clause] { INTO | OVERWRITE } [TABLE] table_name [(column_list)] [ PARTITION (partition_clause)] { [hint_clause] select_statement | VALUES (value [, value ...]) [, (value [, value ...]) ...] } *************************************** -
parseInsert0
-
parseInsertColumns
-
parseStatementListDialect
-
parseDropUser
-
parseDropIndex
-
parseCall
-
parseSet
-
parseAssignItems
-
parseAssignItems
-
parsePartitionRef
-
parseCreatePackage
-
parseCreate
-
createOptionSkip
protected void createOptionSkip() -
createTableRest
-
parseCreateScan
-
parseCreateRole
-
parseCreateTableSpace
-
parseCreateOutline
-
parseCreateServer
-
parseCreateEvent
-
parseCreateType
-
parseCreateTableGroup
-
parseCreateUser
-
parseCreateFunction
-
parseCreateMaterializedViewRest
-
parseCreateMaterializedView
-
parseCreateDbLink
-
parseCreateSynonym
-
parseCreateExternalCatalog
-
parseCreateTrigger
-
parseBlock
-
parseCreateSchema
-
parseCreateTableSupportSchema
public void parseCreateTableSupportSchema() -
parseCreateDatabase
-
parseCreateProcedure
-
parseCreateSequence
-
parseCreateIndex
-
getSQLCreateTableParser
-
parseSelect
-
createSQLSelectParser
-
createSQLSelectParser
-
parseUpdateStatementPartition
-
parseUpdateStatement
-
parseUpdateSetComma
protected void parseUpdateSetComma() -
parseUpdateSet
-
createUpdateStatement
-
parseDeleteStatement
-
parseCreateTable
-
parseCreateViewAfterName
-
parseCreateViewAtDataType
-
parseCreateView
-
createViewAs
-
parseComment
-
parseAlterTableAddColumn
-
parseAlterTableAddColumnBefore
-
parseAlterTableAddColumn
-
parseAlterTableReplaceColumn
-
parseStatement
-
parseExplainFormatPartition
-
parseExplainFormatType
-
parseExplain
-
parseAlterTableAddClusteringKey
-
parseOpen
Parses the SQL OPEN statement and returns the corresponding SQLOpenStatement object.- Returns:
- the parsed SQLOpenStatement object representing the SQL OPEN statement
- Throws:
ParserException- if an error occurs during parsing
-
parseFetch
-
parseClose
-
isParseCompleteValues
public boolean isParseCompleteValues() -
setParseCompleteValues
public void setParseCompleteValues(boolean parseCompleteValues) -
getParseValuesSize
public int getParseValuesSize() -
setParseValuesSize
public void setParseValuesSize(int parseValuesSize) -
parseMerge
-
mergeBeforeName
protected void mergeBeforeName() -
parseErrorLoggingClause
-
parseHints
-
parseDescribe
-
parseWithQuerySkip
protected void parseWithQuerySkip() -
parseWithQuery
-
parseEnd
-
parseWith
-
parseValueClause
protected void parseValueClause(List<SQLInsertStatement.ValuesClause> valueClauseList, int columnSize, SQLObject parent) -
parseValueClauseNative
protected void parseValueClauseNative(List<SQLInsertStatement.ValuesClause> valueClauseList, List<SQLColumnDefinition> columnDefinitionList, int columnSize, SQLObject parent) -
parseValueClause
- Throws:
SQLException
-
parseValueClause
protected void parseValueClause(List<SQLInsertStatement.ValuesClause> valueClauseList, List<SQLColumnDefinition> columnDefinitionList, int columnSize, SQLObject parent) -
getSelectListCache
-
setSelectListCache
-
parseHiveInsertStmt
-
parseHiveInsert
-
parseShowDatabases
-
parseShowTableGroups
-
parseShowTables
-
parseShowColumns
-
alterIndex
-
parseAnalyze
-
alterSequence
-
parseMsck
-
createResource
-
alterResourceGroup
-
alterMaterialized
-
parseHiveCreateFunction
-
parameters
-
parseShowCreateTable
-
parseShowVariants
-
parseClone
-