All Classes and Interfaces
Class
Description
the formatter used to process all the statements
the base processor
the base class for all statment formatters
used to align the alias
this formatter used to treat the empty line, comments, line number and so on.
append an new line after the table name
append an new line after the table name
used to add new line for select items
process the case when clause
used for comma style
combine multiply whitespaces into a single whitespace, and remove the return
token
A stream based parser for parsing delimited text data from a file or a
stream.
A stream based writer for writing delimited text data to a file or a stream.
process the distinct keyword
Used by parser internally.
subtype of alter column in alter table statement.
Teradata datatype attribute
Database vendors supported:
No specific engine for Microsoft ACCESS
EDbVendor.dbvmssql
,EDbVendor.dbvoracle
,EDbVendor.dbvmysql
,EDbVendor.dbvdb2
,
EDbVendor.dbvsybase
, EDbVendor.dbvinformix
,EDbVendor.dbvpostgresql
,EDbVendor.dbvteradata
,
EDbVendor.dbvmdx
,EDbVendor.dbvnetezza
,EDbVendor.dbvhive
,EDbVendor.dbvgreenplum
,EDbVendor.dbvredshift
No specific engine for Microsoft ACCESS
EDbVendor.dbvaccess
, use EDbVendor.dbvmssql
instead.Type of SQL syntax errors.
SQL Server execute as option
scalar expression: return a single value.
Used by parser internally.
source of insert value
Type of
TConstant
Type of parse tree node
query hint type
Oracle/DB2 create view, subquery restriction clause
Used to replace TBaseType.srtNone,srtAsc and srtDesc
Enum for various SQL clause such as where clause, having clause and etc.
database object type
Type of SQL statement.
Enum representing the different types of table attributes in Redshift
Used by parser internally.
Type of source token.
A specification that indicates when triggered SQL statements perform in relation to the triggering event.
the callback interface to achieve the formatter builder
the format options
TExpression
Deprecated.
the processor used to align the keywords in insert statements
the insert statemeent formatter
This is the interface for handling SQL statements after parsing each SQL statement.
use this interface if you like to change token properties generated by lexer
before send to parser.
if you change a source token's TSourceToken#tokencode to TBaseType#cmtslashstar TBaseType#cmtdoublehyphen then, this token will be treated as comment
you may also like to change tokencode of a keyword to TBaseType#ident, this will let parser treat this keyword as an identifier.
if you change a source token's TSourceToken#tokencode to TBaseType#cmtslashstar TBaseType#cmtdoublehyphen then, this token will be treated as comment
you may also like to change tokencode of a keyword to TBaseType#ident, this will let parser treat this keyword as an identifier.
process the join on clause in the select statement
used for align all the keyword
收到新关键字列表后的处理流程,关键字分为 reserved words 和 non-reserved keywords 两种
这两类都是用逗号隔开的字符串表示,如果收到的是 同时包含 reserved words 和 non-reserved keywords 的列表,
需要先分成这两类独立的列表。 可以调用 extractNonReservedKeywords() 把 non-reserved keywords 从 full list 中分类出来。
1.
A simple internal Logger interface.
A factory for
Logger
instances that uses SLF4J if present, falling back on a
java.util.logging implementation otherwise.1.
append an new line after the table name
Container to ease passing around a tuple of two objects.
Container to ease passing around a tuple of two objects.
a formattor para processor factory used for create the processor instance
the select stmt formatter
the select statement builder
the helper class used for operating the source token
This inputstream will recognize unicode BOM marks and will skip bytes if
getEncoding() method is called before any of the read(...) methods.
process the distinct keyword
The column/table alias.
the align style enum
SQL alter audit policy statement
databricks, hana
SQL alter database statement.
SQL alter function statement.
SQL alter index statement.
SQL alter library statement.
SQL alter materialized view statement
TAlterMaterializedViewStmt.getMaterializedViewName()
returns the materialized view namealter session statement
Type of alter table option,
TAlterTableOption.getOptionType()
returns the type of various option:
alter table options
SQL alter table statement.
Snowflake alter task
Deprecated.
As of v1.8.6.3, replaced by
TWindowDef
Window/analytic clause of Window (or analytic) functions.array access of plsql.
BigQuery ARRAY_CONCAT_AGG function
Syntax: ARRAY_CONCAT_AGG(expression [ORDER BY expr [ASC|DESC]] [LIMIT n])
The assignment statement sets the current value of a variable, field, parameter,
or element that has been declared in the current scope.
Snowflake Time Travel SQL extensions
https://docs.snowflake.com/en/user-guide/data-time-travel
The clause uses one of the following parameters to pinpoint the exact historical data you want to access:
TIMESTAMP
OFFSET (time difference in seconds from the present time)
STATEMENT (query ID for statement)
TIMESTAMP
OFFSET (time difference in seconds from the present time)
STATEMENT (query ID for statement)
TAttributeNode 类似 column,但含义更广泛。用来表示 SQL 语句中 table 包含的字段(table 或许用 relation 更准确)。
这里的 table 可以是数据库的基本表,也可以是 from clause 中出现的子查询,或者是 CTE。
GSP 会把 SQL 语句中出现的每个 table 都生成对应的 TAttributeNode 列表,表示该 table 可以在 SQL 中被使用的字段。
例如:一般 table
select column1 from table1
GSP 会在 SQLEnv 中查找 table1 的定义,如果找到(column1,column2,column3), 则 table 会创建三个对应的 TAttributeNode。
用户可以通过
TTable.getAttributes()
来获取。
如果SQLEnv 中没有查找 table1 的定义,则创建一个 star column TAttributeNode, 形如 table1.*
例如:子查询
select column1 from (select c1,c2 from table1) t1
针对上例中的 t1 子查询, GSP 会创建两个 TAttributeNode,对应 t1.c1, t1.c2
针对其他类型的 table, 也做类似处理。为 SQL 中的每个 table 准备好 TAttributeNode 列表,
在接下来的分析中,SQL 语句中出现的 column 引用都应该能找到对应的来源表和 TAttributeNode
相关的属性
TAttributeNode.getName()
, 字段名,不带前缀。
TAttributeNode.getTable_ref()
, 该字段对应的 table,每个在 SQL 语句中出现的 table 都有对应的 TTable
对象。
TAttributeNode.getSqlColumn()
, 如果在 SQLEnv 中找到该 table 的定义,这个方法返回数据库中定义的字段、
TAttributeNode.getSubLevelResultColumn()
, 如果 table 类型为子查询,该方法返回子查询 select list 中的 TResultColumn
对象,为该字段的数据来源。
或者是 values() 中的 result column。Postgresql attribute_option = value
#Todo: this class needs to be replaced by
TNameValuePair
laterTAttributeResolver 的核心职责是为SQL语句中出现的每一个列找到其所属的表。
工作原理:
1.
Automatic Initialization and Updating for TIMESTAMP in MySQL
Base partition of all table partitions, such as range_partitions, list_partitions,
hash_partitions,composite_range_partitions and etc
Constants and functions used by parser internally.
Includes some basic expression statement in plsql.
Bind argument in using_clause of plsql execute_immediate_statement
List of
TBindArgument
TBlockSqlNode represents a block in a stored procedure.
Base class for all sql statements that include multiple sql statements
Call specification in PLSQL when define a function
CASE expressions let you use IF ...
SAP hana case join clause.
SAP hana case join when item.
the case option
The CASE statement chooses from a sequence of conditions, and execute a corresponding statement.
property of character data type, such as character set name, case specific.
The CLOSE statement closes a cursor or cursor variable, thereby allowing its resources to be reused.
Define the characteristics of the column.
TColumnReference represents column, variable, function/procedure parameter
Represents db2,oracle comment on statement.
Represents db2,oracle comment on statement.
sql block may have label name.
sql block with exception clause
Use this clause to define a compound trigger on a DML event.
DB2 procedure compound statement
SQL Server compute clause, including a list of compute clause item which is in syntax:
COMPUTE [compute_expr_list] [BY by_expr_list]
SQL Server compute clause item
Deprecated.
As of v1.8.7.2
SQL constant (sometimes called a literal) specifies a value.
Use a constraint to define an integrity constraint, a rule that restricts the values in a database.
List of
TConstraint
.Internal use in the parser..
Create function.
create an index.
Oracle create materialized view log
Get table name
TCreateMaterializedViewLogSqlStatement.getTableName()
, get column list TCreateMaterializedViewLogSqlStatement.getColumnList()
Internal use in the parser..
Internal use in the parser.
Create procedure statement.
Snowflake create stage
SQL create table statement.
Internal use in the parser.
Create trigger statement.
Define a view, which is a logical table based on one or more tables or views.
A common table expression permits defining a result table with a table-name that can be specified as a table name in any FROM clause of the fullselect that follows.
Collections of
TCTE
.Represents cursor related statement, including:
Base lexer of all databases.
Base parser of all databases.
TCustomSqlStatement is the root class for all SQL statements.
TDatabaseObjectResolver handles the resolution of database objects in SQL statements.
DB2 data change table
datatype attributes supported in various databases.
DAX addmissingitems function
DAX datatable function
DAX Evaluate query.
DAX expression statement, syntax like
Generic class of all DAX functions.
DAX group by function
Base class of function groupby() and summarize().
DAX isonorafter function
Base class of DAX statement
DAX substitutewithindex function
DAX summarize function.
DAX summarizecolumns function.
Deprecated.
since v2.6.4.1, use
TCreateFunctionStmt
instead.Deprecated.
As of v2.5.1.7, replaced by
TCreateProcedureStmt
Deprecated.
As of v2.0.1.0, replaced by
TCreateTriggerStmt
Deprecated.
since v2.8.8.9, use
TIfStmt
insteadCreated by Tako on 2019/7/30.
Single declare cursor sql statement for GaussDB
SQL Server declare variable
List of declare variable
SQL delete statement.
SQLServer, databricks
The DML_event_clause lets you specify one of three DML statements that can cause the trigger to fire.
Create trigger dml event: delete, insert, update [of columns]
used in sql server dml select list
remove an index or domain index from the database.
move a table or object table to the recycle bin or to remove the table and all its data from the database entirely.
remove a view or an object view from the database.
Represents ELSEIF ...
Oracle error logging clause
Including a list of
TExceptionHandler
that process raised exceptions.An exception handler processes a raised exception.
Internal used by parser.
The EXECUTE IMMEDIATE statement builds and executes a dynamic SQL statement in
a single operation.
Parameter of execute statement in SQL Server,teradata
SQL Server execute as clause
Deprecated.
As of v2.3.3.7, replaced by
TExecuteSqlStatement
execute statement
db: couchbase, netezza,greenplum,mysql, postgresql,redshift
The EXIT statement exits a loop and transfers control to the end of the loop.
teradata expand on clause
An expression is a combination of one or more values, operators, and SQL functions that evaluates to a value.
SQL Server value() Method performs an XQuery against the XML and returns a value of SQL type.
the text print
DB2 fetch first clause.
fetch ..
The FETCH statement retrieves rows of data from the result set of a multiple-row query.
The FOR UPDATE clause lets you lock the selected rows so that other users cannot lock
or update the rows until you end your transaction.
Represents table source in from clause of select/delete statement, and update table clause of update statement.
Represents the database function, all functions are represented by this class no matter what's type of the function.
A structure includes function name and arguments
table function return column
Deprecated.
since GSP Java version 2.3.9.3, use
TGetDiagStmt
instead.Deprecated.
As of v1.6.3.7, replaced by
TGrantStmt
This class represents group by clause and having clause.
Deprecated.
As of v1.4.3.3, replaced by
TExpression
Deprecated.
As of v1.4.3.3, replaced by
TExpressionList
GROUPING SETS are a further extension of the GROUP BY clause that let you specify multiple groupings of data.
Gruping set item that used in TGroupingSet
Content of this item can be a TRollupCube instance or a TGroupingExpressionItem instance
Grouping set item list in TGroupingSet.
This is the first class people start to use this SQL parser library.
Teradata handler for clause
Oracle hierarchical_query_clause lets you select rows in a hierarchical order.
Hint clause in Hana
Hive create function.
Deprecated.
since 2.6.2.6, use
TUseDatabase
insteadColumn identity clause.
The IF statement executes or skips a sequence of statements, depending on the value
of a Boolean expression
Deprecated.
as V1.8.7.2, replaced by
TColumnWithSortOrder
index option used in teradata create table statement
Postgresql;
Postgresql, redshift
Deprecated.
As of v1.4.3.3, replaced by
TExpression
Informix create function.
Informix create procedure.
Deprecated.
As of v2.0.1.0, replaced by
TCreateTriggerStmt
Represents an INHERITS clause in a CREATE TABLE statement.
Interal used by parser.
SQL insert statement.
Informix, into table clause.
DB2/Sybase isolation clause
Deprecated.
As of v2.7.4.0, Please use
TJoinExpr
instead.Internal used by parser.
SQL 1:
Teradata json function such as json_agg, json_compose
This class is used to represent a JSON_TABLE function in Oracle and OpenJson function in SQL Server.
Oracle keep dense rank clause used in analytic function.
list values clause in hash partitions
Postgresql locking clause
Deprecated.
As of v1.6.3.7, May add lock statement under package: gudusoft.gsqlparser.stmt
A LOOP statement executes a sequence of statements multiple times.
Query axis clause in select list
MDX function or method.
Mdx identifier consists of a list of segment name
TMdxIdentifierNode.getSegments()
Key segment used in identifier node.
Name segment used in identifier node.
MDX, select statement.
insert clause in merge statement.
Merge SQL statement.
update clause in merge statement.
when [not] matched clause in merge statement.
TMetadataCollector is responsible for collecting metadata information from SQL statements,
particularly focusing on table and function definitions.
SQL Server/ Sybase create function.
SQL Server/ Sybase create procedure statement.
Deprecated.
As of v2.0.1.0, replaced by
TCreateTriggerStmt
SQL SQL create trigger statement.Deprecated.
, use TDropTableSqlStatement instead.
Deprecated.
, use TDropViewSqlStatement instead.
Execute a stored procedure or function,
or Execute a character string
Deprecated.
As of v1.9.4.1, replaced by
TGrantStmt
This class represents if and while SQL statement of SQL Server.
sql server set rowcount statement
Represents a row in value clause of insert statement, or a row in values clause.
Represents one or more rows in the values clause of insert statement, or in the values() clause.
Deprecated.
since GSP Java version 2.5.1.2, use
TCommonBlock
instead.Deprecated.
since GSP Java version 2.5.1.2, use
TCallStatement
instead.Deprecated.
since GSP Java version 2.5.1.2, use
TCreateFunctionStmt
instead.Deprecated.
since GSP Java version 2.3.9.3, use
TCreateProcedureStmt
instead.Deprecated.
As of v2.0.1.0, replaced by
TCreateTriggerStmt
Deprecated.
As of v2.5.1.3, replaced by
TFetchStmt
Deprecated.
since GSP Java version 2.3.9.3, use
TLoopStmt
instead.Deprecated.
As of v2.5.1.3, replaced by
TOpenStmt
Deprecated.
As of v2.0.4.6, replaced by
TRepeatStmt
Deprecated.
since GSP Java version 2.5.1.2, use
TReturnStmt
instead.Deprecated.
since GSP Java version 2.5.1.2, use
TSetStmt
instead.Deprecated.
As of v2.0.5.3, use
TWhileStmt
insteadnetezza generate [express] statistics statement
netezza groom table statement.
Use this clause to define a single trigger on a DDL or database event.
An object access expression specifies attribute reference and method invocation.
The qualified or unqualified name that identifies a database object.
List of TObjectName
Created by IntelliJ IDEA.
PostgreSQL offset clause in select limit
Oracle offset clause in select
Oracle offset clause in select
The OPEN-FOR statement executes the SELECT statement associated with a cursor variable.
The OPEN statement executes the query associated with a cursor.
DB2 Optimize for clause
Deprecated.
As of v1.4.4.5, replaced by
TCreateSequenceStmt
Deprecated.
As of v1.4.4.5, replaced by
TCreateSynonymStmt
List of order by item which is type of
TOrderByItem
.Item in order by clause.
Deprecated.
As of v1.4.9.8, use TExplicitDataTypeConversion instead
teradata output format phrase
Deprecated.
As of v1.4.9.8, use TExplicitDataTypeConversion with instead
Parameters in create procedure/function statements.
List of
TParameterDeclaration
.This class is the root class for all syntax/parse tree nodes.
List of parse tree node.
Deprecated.
As of v1.8.6.0, replaced by
TPartitionClause
used in window function
Partition definition in syntax like:
Hive, Impala, MySQL, Oracle partition clause in from table
Snowflake path object, usually used in stage reference
use the PIVOT and UNPIVOT relational operators to change a table-valued expression into another table.
Oracle create function.
The CREATE PACKAGE statement creates or replaces the specification for a stored package,
which is an encapsulated collection of related procedures, functions,
and other program objects stored together in the database.
This class represents 3 types of SQL statement:
Create procedure statement, creates or replaces a standalone stored procedure or a call specification.
The CREATE TRIGGER statement creates or replaces a database trigger, which is either of the following:
A stored PL/SQL block associated with a table, a schema, or the database.
An anonymous PL/SQL block or a call to a procedure implemented in PL/SQL or Java.
For detailed information about Oracle simple_dml_trigger, compound_dml_trigger, non_dml_trigger
Please check
TTriggeringClause
Deprecated.
As of v2.0.1.0, replaced by
TCreateTriggerStmt
Create triggerThe CREATE TYPE statement creates or replaces
This class is a placeholder for CREATE TYPE statement.
The CREATE TYPE BODY defines or implements the member methods defined in the
object type specification.
The FORALL statement issues a series of static or dynamic DML statements, usually much faster than an equivalent FOR loop.
The GOTO statement branches unconditionally to a statement label or block label.
A record is a composite variable that can store data values of different types.
Deprecated.
As of v1.6.4.1
A collection groups elements of the same type in a specified order.
A collection groups elements of the same type in a specified order.
SQL Server procedure option
expression used in the create function body will be treated as a pseudo expression statement.
teradata qualify clause
The RAISE statement stops normal execution of a PL/SQL block or subprogram and transfers control to an exception handler.
range values clause in range partitions
Deprecated.
since GSP Java version 2.5.2.5, use
TCreateSchemaSqlStatement
instead.Deprecated.
since version, 2.9.3.5, use
TLockTableStmt
instead.Represents the table_attributes for Redshift materialized views
Based on: https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html
Possible distribution styles for Redshift materialized views
Deprecated.
since version 2.5.9.1, use
TUnloadStmt
instead.Postgresql Relation expr parse tree node
TRelationResolver 负责为SQL语句中的每个表收集和初始化属性(attributes)。
这些属性主要包含表的列信息,用于后续解析器(如TAttributeResolver)建立表和列之间的关系。
工作流程:
1.
TRelationResolver 负责为SQL语句中的每个表收集和初始化属性(attributes)。
这些属性主要包含表的列信息,用于后续解析器(如TAttributeResolver)建立表和列之间的关系。
工作流程:
1.
This class represents reset statement of GaussDB.
Oracle, DB2 restrict clause in create view statement
This class represents select_list item in select statement, lets you specify the columns you want to retrieve from the table.
The RETURN statement immediately completes the execution of a subprogram and returns control to the invoker
The ROLLUP operation in the simple_grouping_clause groups the selected rows based on the values of the first n, n-1, n-2, ...
Base class of procedure and function.
supported statements:
alter table
Create table
Create view
Delete
Insert
Merge
Select
Update
Internal used by parser, reprsents raw parse tree node of select statement.
Class
TSelectSqlStatement
represents query specification, query expression and select statement.Deprecated.
since GSP Java version 2.6.1.2, use
TSetStmt
instead.Teradata set session statement related sql node in .y file
Represents a source token which is the basic syntactic unit of SQL.
List of source token.
In the most sql-implementation, Catalog is the anonymous of the Database.
table column
SQL environment includes the metadata of a list of databases.
SQL function
base class of all the database object such as catalog, schema, table, column and etc
SQL procedure
SQL procedure
TSQLResolver handles all semantic analysis and resolution steps for SQL statements.
SQL schema, contains a list of schema objects.
the base class of all schema objects such as procedure, table, trigger and etc.
SQL synonyms object
SQL table, includes a list of columns.
SQL trigger
TStarColumnExpander 负责解析和展开SQL查询中的星号列引用(*)。
工作流程:
1.
TStarColumnPushDownResolver 类负责解析和处理 SQL 查询中的星号(*)列引用,
将星号列引用追溯到实际的表列。
主要工作流程:
1.
List of SQL statements which is instance of class that descends from
TCustomSqlStatement
.block with declaration and parameters
Base class for stored procedure such as create function, procedure, trigger and etc.
Base class for stored procedure such as create function, procedure, trigger and etc.
Oracle subpartition type of composite_range_partitions
Detailed information about syntax error.
Represents various kinds of table source in from clause.
SQL Server table hint:
#TODO Need to be merged into
TPartitionDefinition
Oracle table properties
Teradata create function.
Deprecated.
As of v2.0.7.7, replaced by
TCreateProcedureStmt
Deprecated.
As of v2.0.1.0, replaced by
TCreateTriggerStmt
Indicates that only a specified first set or percent of rows will be returned from the query result set.
One of these 3 event clauses:
dml event clause, ddl event clause, database event clause
subclass:
TDmlEvenClause, TDdlEventClause, TDatabaseEventClause
Including 3 types:
TDmlEventItem, TDdlEventItem, TDatabaseEventItem
Trigger clause including:
action time: before, after, instead of
event type: insert, delete, update, ddl event, database event,
TDmlEventClause
referencing clause: old, new ,parent
There are 3 types of triggering clause: simple dml, compound dml, non-dml.Argument of trim function.
Attribute definition of an object type(
TPlsqlCreateType
)List of attribute definition (
TTypeAttribute
) of an object type.This class represents SQL Datatype.
Athena, Hana, redshift
TeraData UnPack function
SQL update statement.
Snowflake use schema
Deprecated.
since v2.6.2.8, please use
TUseDatabase
instead.represents values() clause.
Deprecated.
As of v2.3.6.9, please use
TMultiTarget
insteadDeprecated.
As of v2.3.6.9, please use
TMultiTargetList
insteadRepresents declare statement that used to decalre variable, constant, exception and subtype.
Base class of all parse tree nodes that can be visited by visitors.
Base class of all visitors that used to visit parse tree nodes.
WhenClause item used in case expr of
TCaseExpression
.List of
TWhenClauseItem
Represents over clause in analytic function.
Deprecated.
As of v1.8.6.0, replaced by
TWindowDef
Deprecated.
As of v1.8.6.0, replaced by
TWindowDef
Oracle within group clause used in analytic function
Openedge with clause in select statement.
Created by tako on 2015/1/20.
the formatter used to format the update statement
TSQLEnv
instead In order to link column to table correctly without connecting to database, we need to provide a class which implements IMetaDatabase to TGSqlParser.