Feat/flink grammar (#73)
* feat: complete flink sql insert statement * feat: complete flink sql drop statement * feat: complete flink sql alert statement * feat: complete flink sql create statement, remove console log * feat: complete flink sql describe, show, explain, use statement * feat(flinksql): add statement, such as set, load * fix(flinksql): fix insert, add temporary table
This commit is contained in:
@ -51,6 +51,7 @@ CASE: 'CASE';
|
||||
WHEN: 'WHEN';
|
||||
THEN: 'THEN';
|
||||
ELSE: 'ELSE';
|
||||
BEGIN: 'BEGIN';
|
||||
END: 'END';
|
||||
JOIN: 'JOIN';
|
||||
CROSS: 'CROSS';
|
||||
@ -60,6 +61,7 @@ LEFT: 'LEFT';
|
||||
SEMI: 'SEMI';
|
||||
RIGHT: 'RIGHT';
|
||||
FULL: 'FULL';
|
||||
USER: 'USER';
|
||||
NATURAL: 'NATURAL';
|
||||
ON: 'ON';
|
||||
PIVOT: 'PIVOT';
|
||||
@ -83,11 +85,18 @@ TABLE: 'TABLE';
|
||||
DIRECTORY: 'DIRECTORY';
|
||||
VIEW: 'VIEW';
|
||||
REPLACE: 'REPLACE';
|
||||
EXECUTE: 'EXECUTE';
|
||||
STATEMENT: 'STATEMENT';
|
||||
INSERT: 'INSERT';
|
||||
DELETE: 'DELETE';
|
||||
REMOVE: 'REMOVE';
|
||||
INTO: 'INTO';
|
||||
DESCRIBE: 'DESCRIBE';
|
||||
EXPLAIN: 'EXPLAIN';
|
||||
PLAN: 'PLAN';
|
||||
CHANGELOG_MODE: 'CHANGELOG_MODE';
|
||||
JSON_EXECUTION_PLAN: 'JSON_EXECUTION_PLAN';
|
||||
ESTIMATED_COST: 'ESTIMATED_COST';
|
||||
FORMAT: 'FORMAT';
|
||||
LOGICAL: 'LOGICAL';
|
||||
CODEGEN: 'CODEGEN';
|
||||
@ -98,6 +107,8 @@ TABLES: 'TABLES';
|
||||
COLUMNS: 'COLUMNS';
|
||||
COLUMN: 'COLUMN';
|
||||
USE: 'USE';
|
||||
MODULE: 'MODULE';
|
||||
MODULES: 'MODULES';
|
||||
PARTITIONS: 'PARTITIONS';
|
||||
FUNCTIONS: 'FUNCTIONS';
|
||||
DROP: 'DROP';
|
||||
@ -209,6 +220,7 @@ RECOVER: 'RECOVER';
|
||||
EXPORT: 'EXPORT';
|
||||
IMPORT: 'IMPORT';
|
||||
LOAD: 'LOAD';
|
||||
UNLOAD: 'UNLOAD';
|
||||
ROLE: 'ROLE';
|
||||
ROLES: 'ROLES';
|
||||
COMPACTIONS: 'COMPACTIONS';
|
||||
@ -236,8 +248,13 @@ GENERATED: 'GENERATED';
|
||||
WATERMARKS: 'WATERMARKS';
|
||||
CATALOG: 'CATALOG';
|
||||
LANGUAGE: 'LANGUAGE';
|
||||
JAVA: 'JAVA';
|
||||
SCALA: 'SCALA';
|
||||
PYTHON: 'PYTHON';
|
||||
JAR: 'JAR';
|
||||
CATALOGS: 'CATALOGS';
|
||||
VIEWS: 'VIEWS';
|
||||
JARS: 'JARS';
|
||||
PRIMARY: 'PRIMARY';
|
||||
KEY: 'KEY';
|
||||
PERIOD: 'PERIOD';
|
||||
@ -329,6 +346,7 @@ BIT_STRING: BIT_STRING_L;
|
||||
ID_LITERAL: ID_LITERAL_FRAG;
|
||||
PLUS_ID_LITERAL: PLUS_ID_LITERAL_FRAG;
|
||||
|
||||
fragment JAR_FILE_PARTTARN: '`' ( '\\'. | '``' | ~('`'|'\\'))* '`';
|
||||
fragment EXPONENT_NUM_PART: 'E' [-+]? DEC_DIGIT+;
|
||||
fragment ID_LITERAL_FRAG: [A-Z_0-9a-z]*?[A-Z_a-z]+?[A-Z_0-9a-z]*;
|
||||
fragment PLUS_ID_LITERAL_FRAG: [A-Z_0-9a-z*@#^$%&{}]*?[A-Z_a-z*@#^$%&{}]+?[A-Z_0-9a-z*@#^$%&{}]*;
|
||||
|
@ -14,6 +14,7 @@ sqlStatements
|
||||
|
||||
sqlStatement
|
||||
: ddlStatement | dmlStatement | describeStatement | explainStatement | useStatement | showStatememt
|
||||
| loadStatement | unloadStatememt | setStatememt | resetStatememt | jarStatememt
|
||||
;
|
||||
|
||||
emptyStatement
|
||||
@ -22,35 +23,77 @@ emptyStatement
|
||||
|
||||
ddlStatement
|
||||
: createTable | createDatabase | createView | createFunction | createCatalog
|
||||
| alterTable | alterDatabase | alterFunction
|
||||
| dropTable | dropDatabase | dropView | dropFunction
|
||||
| alterTable | alertView | alterDatabase | alterFunction
|
||||
| dropCatalog | dropTable | dropDatabase | dropView | dropFunction
|
||||
;
|
||||
|
||||
dmlStatement
|
||||
: queryStatement | insertStatement
|
||||
;
|
||||
|
||||
// some statemen
|
||||
describeStatement
|
||||
: DESCRIBE uid
|
||||
: (DESCRIBE | DESC) uid
|
||||
;
|
||||
|
||||
explainStatement
|
||||
: EXPLAIN identifier FOR dmlStatement
|
||||
: EXPLAIN (explainDetails | PLAN FOR)? (dmlStatement | insertSimpleStatement | insertMulStatement)
|
||||
;
|
||||
|
||||
explainDetails
|
||||
: explainDetail (COMMA explainDetail)*
|
||||
;
|
||||
|
||||
explainDetail
|
||||
: CHANGELOG_MODE | JSON_EXECUTION_PLAN | ESTIMATED_COST
|
||||
;
|
||||
|
||||
useStatement
|
||||
: USE CATALOG? uid
|
||||
: USE CATALOG? uid | useModuleStatement
|
||||
;
|
||||
|
||||
useModuleStatement
|
||||
: USE MODULES uid (COMMA uid)*
|
||||
;
|
||||
|
||||
showStatememt
|
||||
: SHOW (CATALOGS | DATABASES | TABLES | FUNCTIONS | VIEWS)
|
||||
: SHOW (CATALOGS | DATABASES | VIEWS | JARS)
|
||||
| SHOW CURRENT (CATALOG | DATABASE)
|
||||
| SHOW TABLES (( FROM | IN ) uid)? likePredicate?
|
||||
| SHOW COLUMNS ( FROM | IN ) uid likePredicate?
|
||||
| SHOW CREATE (TABLE | VIEW) uid
|
||||
| SHOW USER? FUNCTIONS
|
||||
| SHOW FULL? MODULES
|
||||
;
|
||||
|
||||
loadStatement
|
||||
: LOAD MODULE uid (WITH tablePropertyList)?
|
||||
;
|
||||
|
||||
unloadStatememt
|
||||
: UNLOAD MODULE uid
|
||||
;
|
||||
|
||||
setStatememt
|
||||
: SET (tableProperty)?
|
||||
;
|
||||
|
||||
resetStatememt
|
||||
: RESET tablePropertyKey?
|
||||
;
|
||||
|
||||
jarStatememt
|
||||
: (ADD | REMOVE) JAR jarFileName
|
||||
;
|
||||
|
||||
// Create statements
|
||||
|
||||
createTable
|
||||
: CREATE TABLE ifNotExists? sourceTable
|
||||
: (simpleCreateTable | createTableAsSelect)
|
||||
;
|
||||
|
||||
simpleCreateTable
|
||||
: CREATE TEMPORARY? TABLE ifNotExists? sourceTable
|
||||
LR_BRACKET
|
||||
columnOptionDefinition (COMMA columnOptionDefinition)*
|
||||
(COMMA watermarkDefinition)?
|
||||
@ -63,6 +106,14 @@ createTable
|
||||
likeDefinition?
|
||||
;
|
||||
|
||||
/*
|
||||
* 详见 https://nightlies.apache.org/flink/flink-docs-release-1.16/docs/dev/table/sql/create/#as-select_statement
|
||||
* CTAS 不支持指定显示指定列,不支持创建分区表,临时表
|
||||
*/
|
||||
createTableAsSelect
|
||||
: CREATE TABLE ifNotExists? sourceTable withOption (AS queryStatement)?
|
||||
;
|
||||
|
||||
columnOptionDefinition
|
||||
: physicalColumnDefinition
|
||||
| metadataColumnDefinition
|
||||
@ -204,7 +255,15 @@ createView
|
||||
;
|
||||
|
||||
createFunction
|
||||
: CREATE (TEMPORARY|TEMPORARY SYSTEM) FUNCTION ifNotExists? uid AS identifier (LANGUAGE identifier)?
|
||||
: CREATE (TEMPORARY|TEMPORARY SYSTEM)? FUNCTION ifNotExists? uid AS identifier (LANGUAGE (JAVA|SCALA|PYTHON))? usingClause?
|
||||
;
|
||||
|
||||
usingClause
|
||||
: USING JAR jarFileName (COMMA JAR jarFileName)*
|
||||
;
|
||||
|
||||
jarFileName
|
||||
: STRING_LITERAL
|
||||
;
|
||||
|
||||
// Alter statements
|
||||
@ -221,19 +280,27 @@ setKeyValueDefinition
|
||||
: SET tablePropertyList
|
||||
;
|
||||
|
||||
alertView
|
||||
: ALTER VIEW uid (renameDefinition | AS queryStatement)
|
||||
;
|
||||
|
||||
alterDatabase
|
||||
: ALTER DATABASE uid setKeyValueDefinition
|
||||
;
|
||||
|
||||
alterFunction
|
||||
: ALTER (TEMPORARY|TEMPORARY SYSTEM) FUNCTION ifExists? uid AS identifier (LANGUAGE identifier)?
|
||||
: ALTER (TEMPORARY|TEMPORARY SYSTEM)? FUNCTION ifExists? uid AS identifier (LANGUAGE (JAVA|SCALA|PYTHON))?
|
||||
;
|
||||
|
||||
|
||||
// Drop statements
|
||||
|
||||
dropCatalog
|
||||
: DROP CATALOG ifExists? uid
|
||||
;
|
||||
|
||||
dropTable
|
||||
: DROP TABLE ifExists? uid
|
||||
: DROP TEMPORARY? TABLE ifExists? uid
|
||||
;
|
||||
|
||||
dropDatabase
|
||||
@ -252,9 +319,13 @@ dropFunction
|
||||
// Insert statements
|
||||
|
||||
insertStatement
|
||||
: (EXECUTE? insertSimpleStatement) | insertMulStatementCompatibility | (EXECUTE insertMulStatement)
|
||||
;
|
||||
|
||||
insertSimpleStatement
|
||||
: INSERT (INTO | OVERWRITE) uid
|
||||
(
|
||||
insertPartitionDefinition? queryStatement
|
||||
insertPartitionDefinition? insertColumnListDefinition? queryStatement
|
||||
| valuesDefinition
|
||||
)
|
||||
;
|
||||
@ -263,6 +334,10 @@ insertPartitionDefinition
|
||||
: PARTITION tablePropertyList
|
||||
;
|
||||
|
||||
insertColumnListDefinition
|
||||
: LR_BRACKET columnNameList RR_BRACKET
|
||||
;
|
||||
|
||||
valuesDefinition
|
||||
: VALUES valuesRowDefinition (COMMA valuesRowDefinition)*
|
||||
;
|
||||
@ -273,6 +348,14 @@ valuesRowDefinition
|
||||
RR_BRACKET
|
||||
;
|
||||
|
||||
insertMulStatementCompatibility
|
||||
: BEGIN STATEMENT SET SEMICOLON (insertSimpleStatement SEMICOLON)+ END
|
||||
;
|
||||
|
||||
insertMulStatement
|
||||
: STATEMENT SET BEGIN (insertSimpleStatement SEMICOLON)+ END
|
||||
;
|
||||
|
||||
|
||||
// Select statements
|
||||
|
||||
@ -438,6 +521,11 @@ predicate
|
||||
| IS NOT? kind=DISTINCT FROM right=valueExpression
|
||||
;
|
||||
|
||||
likePredicate
|
||||
: NOT? kind=LIKE quantifier=(ANY | ALL) ('('')' | '(' expression (',' expression)* ')')
|
||||
| NOT? kind=LIKE pattern=valueExpression
|
||||
;
|
||||
|
||||
valueExpression
|
||||
: primaryExpression #valueExpressionDefault
|
||||
| operator=('-' | '+' | '~') valueExpression #arithmeticUnary
|
||||
@ -1115,6 +1203,7 @@ nonReserved
|
||||
| UNSET
|
||||
| UNNEST
|
||||
| USE
|
||||
| USER
|
||||
| VALUES
|
||||
| VARBINARY
|
||||
| VARCHAR
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
// Generated from /Users/ziv/github.com/dt-sql-parser/src/grammar/flinksql/FlinkSqlParser.g4 by ANTLR 4.8
|
||||
// Generated from /Users/yuwan/Desktop/yuwan/dt-sql-parser/src/grammar/flinksql/FlinkSqlParser.g4 by ANTLR 4.8
|
||||
// jshint ignore: start
|
||||
var antlr4 = require('antlr4/index');
|
||||
|
||||
@ -92,6 +92,24 @@ FlinkSqlParserListener.prototype.exitExplainStatement = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#explainDetails.
|
||||
FlinkSqlParserListener.prototype.enterExplainDetails = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#explainDetails.
|
||||
FlinkSqlParserListener.prototype.exitExplainDetails = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#explainDetail.
|
||||
FlinkSqlParserListener.prototype.enterExplainDetail = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#explainDetail.
|
||||
FlinkSqlParserListener.prototype.exitExplainDetail = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#useStatement.
|
||||
FlinkSqlParserListener.prototype.enterUseStatement = function(ctx) {
|
||||
};
|
||||
@ -101,6 +119,15 @@ FlinkSqlParserListener.prototype.exitUseStatement = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#useModuleStatement.
|
||||
FlinkSqlParserListener.prototype.enterUseModuleStatement = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#useModuleStatement.
|
||||
FlinkSqlParserListener.prototype.exitUseModuleStatement = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#showStatememt.
|
||||
FlinkSqlParserListener.prototype.enterShowStatememt = function(ctx) {
|
||||
};
|
||||
@ -110,6 +137,51 @@ FlinkSqlParserListener.prototype.exitShowStatememt = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#loadStatement.
|
||||
FlinkSqlParserListener.prototype.enterLoadStatement = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#loadStatement.
|
||||
FlinkSqlParserListener.prototype.exitLoadStatement = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#unloadStatememt.
|
||||
FlinkSqlParserListener.prototype.enterUnloadStatememt = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#unloadStatememt.
|
||||
FlinkSqlParserListener.prototype.exitUnloadStatememt = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#setStatememt.
|
||||
FlinkSqlParserListener.prototype.enterSetStatememt = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#setStatememt.
|
||||
FlinkSqlParserListener.prototype.exitSetStatememt = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#resetStatememt.
|
||||
FlinkSqlParserListener.prototype.enterResetStatememt = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#resetStatememt.
|
||||
FlinkSqlParserListener.prototype.exitResetStatememt = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#jarStatememt.
|
||||
FlinkSqlParserListener.prototype.enterJarStatememt = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#jarStatememt.
|
||||
FlinkSqlParserListener.prototype.exitJarStatememt = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#createTable.
|
||||
FlinkSqlParserListener.prototype.enterCreateTable = function(ctx) {
|
||||
};
|
||||
@ -119,6 +191,24 @@ FlinkSqlParserListener.prototype.exitCreateTable = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#simpleCreateTable.
|
||||
FlinkSqlParserListener.prototype.enterSimpleCreateTable = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#simpleCreateTable.
|
||||
FlinkSqlParserListener.prototype.exitSimpleCreateTable = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#createTableAsSelect.
|
||||
FlinkSqlParserListener.prototype.enterCreateTableAsSelect = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#createTableAsSelect.
|
||||
FlinkSqlParserListener.prototype.exitCreateTableAsSelect = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#columnOptionDefinition.
|
||||
FlinkSqlParserListener.prototype.enterColumnOptionDefinition = function(ctx) {
|
||||
};
|
||||
@ -416,6 +506,24 @@ FlinkSqlParserListener.prototype.exitCreateFunction = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#usingClause.
|
||||
FlinkSqlParserListener.prototype.enterUsingClause = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#usingClause.
|
||||
FlinkSqlParserListener.prototype.exitUsingClause = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#jarFileName.
|
||||
FlinkSqlParserListener.prototype.enterJarFileName = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#jarFileName.
|
||||
FlinkSqlParserListener.prototype.exitJarFileName = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#alterTable.
|
||||
FlinkSqlParserListener.prototype.enterAlterTable = function(ctx) {
|
||||
};
|
||||
@ -443,6 +551,15 @@ FlinkSqlParserListener.prototype.exitSetKeyValueDefinition = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#alertView.
|
||||
FlinkSqlParserListener.prototype.enterAlertView = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#alertView.
|
||||
FlinkSqlParserListener.prototype.exitAlertView = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#alterDatabase.
|
||||
FlinkSqlParserListener.prototype.enterAlterDatabase = function(ctx) {
|
||||
};
|
||||
@ -461,6 +578,15 @@ FlinkSqlParserListener.prototype.exitAlterFunction = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#dropCatalog.
|
||||
FlinkSqlParserListener.prototype.enterDropCatalog = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#dropCatalog.
|
||||
FlinkSqlParserListener.prototype.exitDropCatalog = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#dropTable.
|
||||
FlinkSqlParserListener.prototype.enterDropTable = function(ctx) {
|
||||
};
|
||||
@ -506,6 +632,15 @@ FlinkSqlParserListener.prototype.exitInsertStatement = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#insertSimpleStatement.
|
||||
FlinkSqlParserListener.prototype.enterInsertSimpleStatement = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#insertSimpleStatement.
|
||||
FlinkSqlParserListener.prototype.exitInsertSimpleStatement = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#insertPartitionDefinition.
|
||||
FlinkSqlParserListener.prototype.enterInsertPartitionDefinition = function(ctx) {
|
||||
};
|
||||
@ -515,6 +650,15 @@ FlinkSqlParserListener.prototype.exitInsertPartitionDefinition = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#insertColumnListDefinition.
|
||||
FlinkSqlParserListener.prototype.enterInsertColumnListDefinition = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#insertColumnListDefinition.
|
||||
FlinkSqlParserListener.prototype.exitInsertColumnListDefinition = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#valuesDefinition.
|
||||
FlinkSqlParserListener.prototype.enterValuesDefinition = function(ctx) {
|
||||
};
|
||||
@ -533,6 +677,24 @@ FlinkSqlParserListener.prototype.exitValuesRowDefinition = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#insertMulStatementCompatibility.
|
||||
FlinkSqlParserListener.prototype.enterInsertMulStatementCompatibility = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#insertMulStatementCompatibility.
|
||||
FlinkSqlParserListener.prototype.exitInsertMulStatementCompatibility = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#insertMulStatement.
|
||||
FlinkSqlParserListener.prototype.enterInsertMulStatement = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#insertMulStatement.
|
||||
FlinkSqlParserListener.prototype.exitInsertMulStatement = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#queryStatement.
|
||||
FlinkSqlParserListener.prototype.enterQueryStatement = function(ctx) {
|
||||
};
|
||||
@ -839,6 +1001,15 @@ FlinkSqlParserListener.prototype.exitPredicate = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#likePredicate.
|
||||
FlinkSqlParserListener.prototype.enterLikePredicate = function(ctx) {
|
||||
};
|
||||
|
||||
// Exit a parse tree produced by FlinkSqlParser#likePredicate.
|
||||
FlinkSqlParserListener.prototype.exitLikePredicate = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Enter a parse tree produced by FlinkSqlParser#valueExpressionDefault.
|
||||
FlinkSqlParserListener.prototype.enterValueExpressionDefault = function(ctx) {
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Generated from /Users/ziv/github.com/dt-sql-parser/src/grammar/flinksql/FlinkSqlParser.g4 by ANTLR 4.8
|
||||
// Generated from /Users/yuwan/Desktop/yuwan/dt-sql-parser/src/grammar/flinksql/FlinkSqlParser.g4 by ANTLR 4.8
|
||||
// jshint ignore: start
|
||||
var antlr4 = require('antlr4/index');
|
||||
|
||||
@ -66,24 +66,84 @@ FlinkSqlParserVisitor.prototype.visitExplainStatement = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#explainDetails.
|
||||
FlinkSqlParserVisitor.prototype.visitExplainDetails = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#explainDetail.
|
||||
FlinkSqlParserVisitor.prototype.visitExplainDetail = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#useStatement.
|
||||
FlinkSqlParserVisitor.prototype.visitUseStatement = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#useModuleStatement.
|
||||
FlinkSqlParserVisitor.prototype.visitUseModuleStatement = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#showStatememt.
|
||||
FlinkSqlParserVisitor.prototype.visitShowStatememt = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#loadStatement.
|
||||
FlinkSqlParserVisitor.prototype.visitLoadStatement = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#unloadStatememt.
|
||||
FlinkSqlParserVisitor.prototype.visitUnloadStatememt = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#setStatememt.
|
||||
FlinkSqlParserVisitor.prototype.visitSetStatememt = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#resetStatememt.
|
||||
FlinkSqlParserVisitor.prototype.visitResetStatememt = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#jarStatememt.
|
||||
FlinkSqlParserVisitor.prototype.visitJarStatememt = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#createTable.
|
||||
FlinkSqlParserVisitor.prototype.visitCreateTable = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#simpleCreateTable.
|
||||
FlinkSqlParserVisitor.prototype.visitSimpleCreateTable = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#createTableAsSelect.
|
||||
FlinkSqlParserVisitor.prototype.visitCreateTableAsSelect = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#columnOptionDefinition.
|
||||
FlinkSqlParserVisitor.prototype.visitColumnOptionDefinition = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
@ -282,6 +342,18 @@ FlinkSqlParserVisitor.prototype.visitCreateFunction = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#usingClause.
|
||||
FlinkSqlParserVisitor.prototype.visitUsingClause = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#jarFileName.
|
||||
FlinkSqlParserVisitor.prototype.visitJarFileName = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#alterTable.
|
||||
FlinkSqlParserVisitor.prototype.visitAlterTable = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
@ -300,6 +372,12 @@ FlinkSqlParserVisitor.prototype.visitSetKeyValueDefinition = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#alertView.
|
||||
FlinkSqlParserVisitor.prototype.visitAlertView = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#alterDatabase.
|
||||
FlinkSqlParserVisitor.prototype.visitAlterDatabase = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
@ -312,6 +390,12 @@ FlinkSqlParserVisitor.prototype.visitAlterFunction = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#dropCatalog.
|
||||
FlinkSqlParserVisitor.prototype.visitDropCatalog = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#dropTable.
|
||||
FlinkSqlParserVisitor.prototype.visitDropTable = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
@ -342,12 +426,24 @@ FlinkSqlParserVisitor.prototype.visitInsertStatement = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#insertSimpleStatement.
|
||||
FlinkSqlParserVisitor.prototype.visitInsertSimpleStatement = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#insertPartitionDefinition.
|
||||
FlinkSqlParserVisitor.prototype.visitInsertPartitionDefinition = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#insertColumnListDefinition.
|
||||
FlinkSqlParserVisitor.prototype.visitInsertColumnListDefinition = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#valuesDefinition.
|
||||
FlinkSqlParserVisitor.prototype.visitValuesDefinition = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
@ -360,6 +456,18 @@ FlinkSqlParserVisitor.prototype.visitValuesRowDefinition = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#insertMulStatementCompatibility.
|
||||
FlinkSqlParserVisitor.prototype.visitInsertMulStatementCompatibility = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#insertMulStatement.
|
||||
FlinkSqlParserVisitor.prototype.visitInsertMulStatement = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#queryStatement.
|
||||
FlinkSqlParserVisitor.prototype.visitQueryStatement = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
@ -564,6 +672,12 @@ FlinkSqlParserVisitor.prototype.visitPredicate = function(ctx) {
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#likePredicate.
|
||||
FlinkSqlParserVisitor.prototype.visitLikePredicate = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
};
|
||||
|
||||
|
||||
// Visit a parse tree produced by FlinkSqlParser#valueExpressionDefault.
|
||||
FlinkSqlParserVisitor.prototype.visitValueExpressionDefault = function(ctx) {
|
||||
return this.visitChildren(ctx);
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Generated from /Users/ziv/github.com/dt-sql-parser/src/grammar/pgsql/PostgreSQLLexer.g4 by ANTLR 4.8
|
||||
// Generated from /Users/salvo/dt-sql-parser2/src/grammar/pgsql/PostgreSQLLexer.g4 by ANTLR 4.8
|
||||
// jshint ignore: start
|
||||
var antlr4 = require('antlr4/index');
|
||||
|
||||
@ -4737,7 +4737,7 @@ PostgreSQLLexer.prototype.Operator_action = function(localctx , actionIndex) {
|
||||
switch (actionIndex) {
|
||||
case 0:
|
||||
|
||||
HandleLessLessGreaterGreater();
|
||||
this.HandleLessLessGreaterGreater();
|
||||
|
||||
break;
|
||||
default:
|
||||
@ -4748,7 +4748,7 @@ PostgreSQLLexer.prototype.Operator_action = function(localctx , actionIndex) {
|
||||
PostgreSQLLexer.prototype.BeginDollarStringConstant_action = function(localctx , actionIndex) {
|
||||
switch (actionIndex) {
|
||||
case 1:
|
||||
pushTag();
|
||||
this.pushTag();
|
||||
break;
|
||||
default:
|
||||
throw "No registered action for:" + actionIndex;
|
||||
@ -4758,7 +4758,7 @@ PostgreSQLLexer.prototype.BeginDollarStringConstant_action = function(localctx ,
|
||||
PostgreSQLLexer.prototype.NumericFail_action = function(localctx , actionIndex) {
|
||||
switch (actionIndex) {
|
||||
case 2:
|
||||
HandleNumericFail();
|
||||
this.HandleNumericFail();
|
||||
break;
|
||||
default:
|
||||
throw "No registered action for:" + actionIndex;
|
||||
@ -4769,7 +4769,7 @@ PostgreSQLLexer.prototype.UnterminatedBlockComment_action = function(localctx ,
|
||||
switch (actionIndex) {
|
||||
case 3:
|
||||
|
||||
UnterminatedBlockCommentDebugAssert();
|
||||
this.UnterminatedBlockCommentDebugAssert();
|
||||
|
||||
break;
|
||||
default:
|
||||
@ -4798,7 +4798,7 @@ PostgreSQLLexer.prototype.AfterEscapeStringConstantWithNewlineMode_NotContinued_
|
||||
PostgreSQLLexer.prototype.EndDollarStringConstant_action = function(localctx , actionIndex) {
|
||||
switch (actionIndex) {
|
||||
case 6:
|
||||
popTag();
|
||||
this.popTag();
|
||||
break;
|
||||
default:
|
||||
throw "No registered action for:" + actionIndex;
|
||||
@ -4822,11 +4822,11 @@ PostgreSQLLexer.prototype.sempred = function(localctx, ruleIndex, predIndex) {
|
||||
PostgreSQLLexer.prototype.Operator_sempred = function(localctx, predIndex) {
|
||||
switch(predIndex) {
|
||||
case 0:
|
||||
return checkLA('-');
|
||||
return this.checkLA('-');
|
||||
case 1:
|
||||
return checkLA('*');
|
||||
return this.checkLA('*');
|
||||
case 2:
|
||||
return checkLA('*');
|
||||
return this.checkLA('*');
|
||||
default:
|
||||
throw "No predicate with index:" + predIndex;
|
||||
}
|
||||
@ -4835,11 +4835,11 @@ PostgreSQLLexer.prototype.Operator_sempred = function(localctx, predIndex) {
|
||||
PostgreSQLLexer.prototype.OperatorEndingWithPlusMinus_sempred = function(localctx, predIndex) {
|
||||
switch(predIndex) {
|
||||
case 3:
|
||||
return checkLA('-');
|
||||
return this.checkLA('-');
|
||||
case 4:
|
||||
return checkLA('*');
|
||||
return this.checkLA('*');
|
||||
case 5:
|
||||
return checkLA('-');
|
||||
return this.checkLA('-');
|
||||
default:
|
||||
throw "No predicate with index:" + predIndex;
|
||||
}
|
||||
@ -4848,10 +4848,10 @@ PostgreSQLLexer.prototype.OperatorEndingWithPlusMinus_sempred = function(localct
|
||||
PostgreSQLLexer.prototype.IdentifierStartChar_sempred = function(localctx, predIndex) {
|
||||
switch(predIndex) {
|
||||
case 6:
|
||||
return charIsLetter();
|
||||
return this.charIsLetter();
|
||||
case 7:
|
||||
return
|
||||
CheckIfUtf32Letter()
|
||||
return
|
||||
this.CheckIfUtf32Letter()
|
||||
;
|
||||
default:
|
||||
throw "No predicate with index:" + predIndex;
|
||||
@ -4861,7 +4861,7 @@ PostgreSQLLexer.prototype.IdentifierStartChar_sempred = function(localctx, predI
|
||||
PostgreSQLLexer.prototype.EndDollarStringConstant_sempred = function(localctx, predIndex) {
|
||||
switch(predIndex) {
|
||||
case 8:
|
||||
return isTag();
|
||||
return this.isTag();
|
||||
default:
|
||||
throw "No predicate with index:" + predIndex;
|
||||
}
|
||||
|
Reference in New Issue
Block a user