dt-sql-parser 4.1.2-beta.1 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -0
- package/dist/lib/flink/FlinkSqlLexer.d.ts +2 -2
- package/dist/lib/flink/FlinkSqlLexer.js +21 -20
- package/dist/lib/flink/FlinkSqlParser.d.ts +178 -168
- package/dist/lib/flink/FlinkSqlParser.js +2799 -2741
- package/dist/lib/flink/FlinkSqlParserListener.d.ts +11 -0
- package/dist/lib/flink/FlinkSqlParserVisitor.d.ts +7 -0
- package/dist/lib/hive/HiveSqlParser.d.ts +241 -221
- package/dist/lib/hive/HiveSqlParser.js +6229 -5639
- package/dist/lib/hive/HiveSqlParserListener.d.ts +22 -0
- package/dist/lib/hive/HiveSqlParserVisitor.d.ts +14 -0
- package/dist/lib/impala/ImpalaSqlLexer.d.ts +2 -2
- package/dist/lib/impala/ImpalaSqlLexer.js +5 -5
- package/dist/lib/impala/ImpalaSqlParser.d.ts +147 -109
- package/dist/lib/impala/ImpalaSqlParser.js +3448 -3234
- package/dist/lib/impala/ImpalaSqlParserListener.d.ts +44 -0
- package/dist/lib/impala/ImpalaSqlParserVisitor.d.ts +28 -0
- package/dist/lib/mysql/MySqlLexer.d.ts +2 -2
- package/dist/lib/mysql/MySqlLexer.js +43 -43
- package/dist/lib/mysql/MySqlParser.d.ts +2 -2
- package/dist/lib/mysql/MySqlParser.js +42 -42
- package/dist/lib/postgresql/PostgreSqlLexer.d.ts +14 -15
- package/dist/lib/postgresql/PostgreSqlLexer.js +2077 -2092
- package/dist/lib/postgresql/PostgreSqlParser.d.ts +152 -131
- package/dist/lib/postgresql/PostgreSqlParser.js +10052 -9925
- package/dist/lib/postgresql/PostgreSqlParserListener.d.ts +22 -0
- package/dist/lib/postgresql/PostgreSqlParserVisitor.d.ts +14 -0
- package/dist/lib/spark/SparkSqlLexer.d.ts +2 -2
- package/dist/lib/spark/SparkSqlLexer.js +6 -6
- package/dist/lib/spark/SparkSqlParser.d.ts +391 -623
- package/dist/lib/spark/SparkSqlParser.js +6749 -8109
- package/dist/lib/spark/SparkSqlParserListener.d.ts +38 -326
- package/dist/lib/spark/SparkSqlParserVisitor.d.ts +24 -207
- package/dist/lib/trino/TrinoSqlLexer.d.ts +2 -2
- package/dist/lib/trino/TrinoSqlLexer.js +5 -5
- package/dist/lib/trino/TrinoSqlListener.d.ts +44 -0
- package/dist/lib/trino/TrinoSqlParser.d.ts +182 -153
- package/dist/lib/trino/TrinoSqlParser.js +4758 -4599
- package/dist/lib/trino/TrinoSqlVisitor.d.ts +28 -0
- package/dist/parser/common/basicSQL.d.ts +43 -9
- package/dist/parser/common/basicSQL.js +147 -40
- package/dist/parser/common/semanticContextCollector.d.ts +50 -0
- package/dist/parser/common/semanticContextCollector.js +202 -0
- package/dist/parser/common/tokenUtils.d.ts +12 -0
- package/dist/parser/common/tokenUtils.js +38 -0
- package/dist/parser/common/types.d.ts +25 -0
- package/dist/parser/common/types.js +7 -0
- package/dist/parser/flink/flinkErrorListener.js +14 -2
- package/dist/parser/flink/flinkSemanticContextCollector.d.ts +9 -0
- package/dist/parser/flink/flinkSemanticContextCollector.js +14 -0
- package/dist/parser/flink/index.d.ts +4 -2
- package/dist/parser/flink/index.js +22 -14
- package/dist/parser/hive/hiveErrorListener.js +9 -3
- package/dist/parser/hive/hiveSemanticContextCollector.d.ts +9 -0
- package/dist/parser/hive/hiveSemanticContextCollector.js +14 -0
- package/dist/parser/hive/index.d.ts +4 -2
- package/dist/parser/hive/index.js +29 -14
- package/dist/parser/impala/ImpalaErrorListener.js +8 -2
- package/dist/parser/impala/impalaSemanticContextCollector.d.ts +9 -0
- package/dist/parser/impala/impalaSemanticContextCollector.js +14 -0
- package/dist/parser/impala/index.d.ts +4 -2
- package/dist/parser/impala/index.js +21 -14
- package/dist/parser/mysql/index.d.ts +4 -2
- package/dist/parser/mysql/index.js +10 -14
- package/dist/parser/mysql/mysqlErrorListener.js +6 -2
- package/dist/parser/mysql/mysqlSemanticContextCollector.d.ts +9 -0
- package/dist/parser/mysql/mysqlSemanticContextCollector.js +14 -0
- package/dist/parser/postgresql/index.d.ts +4 -2
- package/dist/parser/postgresql/index.js +23 -14
- package/dist/parser/postgresql/postgreErrorListener.js +9 -3
- package/dist/parser/postgresql/postgreSemanticContextCollector.d.ts +9 -0
- package/dist/parser/postgresql/postgreSemanticContextCollector.js +14 -0
- package/dist/parser/spark/index.d.ts +4 -2
- package/dist/parser/spark/index.js +26 -14
- package/dist/parser/spark/sparkErrorListener.js +9 -3
- package/dist/parser/spark/sparkSemanticContextCollector.d.ts +9 -0
- package/dist/parser/spark/sparkSemanticContextCollector.js +14 -0
- package/dist/parser/trino/index.d.ts +4 -2
- package/dist/parser/trino/index.js +22 -14
- package/dist/parser/trino/trinoErrorListener.js +9 -3
- package/dist/parser/trino/trinoSemanticContextCollector.d.ts +9 -0
- package/dist/parser/trino/trinoSemanticContextCollector.js +14 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -357,6 +357,57 @@ Call the `getAllEntities` method on the SQL instance, and pass in the sql text a
|
|
|
357
357
|
|
|
358
358
|
Position is not required, if the position is passed, then in the collected entities, if the entity is located under the statement where the corresponding position is located, then the statement object to which the entity belongs will be marked with `isContainCaret`, which can help you quickly filter out the required entities when combined with the code completion function.
|
|
359
359
|
|
|
360
|
+
### Get semantic context information
|
|
361
|
+
|
|
362
|
+
Call the `getSemanticContextAtCaretPosition` method on the SQL instance, passing in the sql text and the line and column numbers at the specified position, for example:
|
|
363
|
+
|
|
364
|
+
```typescript
|
|
365
|
+
import { HiveSQL } from 'dt-sql-parser';
|
|
366
|
+
|
|
367
|
+
const hive = new HiveSQL();
|
|
368
|
+
const sql = 'SELECT * FROM tb;';
|
|
369
|
+
const pos = { lineNumber: 1, column: 18 }; // after 'tb;'
|
|
370
|
+
const semanticContext = hive.getSemanticContextAtCaretPosition(sql, pos);
|
|
371
|
+
|
|
372
|
+
console.log(semanticContext);
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
*output*
|
|
376
|
+
|
|
377
|
+
```typescript
|
|
378
|
+
/*
|
|
379
|
+
{
|
|
380
|
+
isStatementBeginning: true,
|
|
381
|
+
}
|
|
382
|
+
*/
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
Currently, the semantic context information that can be collected is as follows. If there are more requirements, please submit an [issue](https://github.com/DTStack/dt-sql-parser/issues).
|
|
386
|
+
|
|
387
|
+
- `isStatementBeginning` Whether the current input position is the beginning of a statement
|
|
388
|
+
|
|
389
|
+
The **default strategy** for `isStatementBeginning` is `SqlSplitStrategy.STRICT`
|
|
390
|
+
|
|
391
|
+
There are two optional strategies:
|
|
392
|
+
- `SqlSplitStrategy.STRICT` Strict strategy, only the statement delimiter `;` is used as the identifier for the end of the previous statement
|
|
393
|
+
- `SqlSplitStrategy.LOOSE` Loose strategy, based on the syntax parsing tree to split SQL
|
|
394
|
+
|
|
395
|
+
The difference between the two strategies:
|
|
396
|
+
For example, if the input SQL is:
|
|
397
|
+
```sql
|
|
398
|
+
CREATE TABLE tb (id INT)
|
|
399
|
+
|
|
400
|
+
SELECT
|
|
401
|
+
```
|
|
402
|
+
In the `SqlSplitStrategy.STRICT` strategy, `isStatementBeginning` is `false`, because the CREATE statement is not terminated by a semicolon.
|
|
403
|
+
|
|
404
|
+
In the `SqlSplitStrategy.LOOSE` strategy, `isStatementBeginning` is `true`, because the syntax parsing tree splits the SQL into two independent statements: CREATE and SELECT.
|
|
405
|
+
|
|
406
|
+
You can set the strategy through the third `options` parameter:
|
|
407
|
+
```typescript
|
|
408
|
+
hive.getSemanticContextAtCaretPosition(sql, pos, { splitSqlStrategy: SqlSplitStrategy.LOOSE });
|
|
409
|
+
```
|
|
410
|
+
|
|
360
411
|
### Other API
|
|
361
412
|
|
|
362
413
|
- `createLexer` Create an instance of Antlr4 Lexer and return it;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as antlr from "antlr4ng";
|
|
2
2
|
export declare class FlinkSqlLexer extends antlr.Lexer {
|
|
3
|
-
static readonly
|
|
4
|
-
static readonly
|
|
3
|
+
static readonly WHITE_SPACE = 1;
|
|
4
|
+
static readonly BRACKETED_COMMENT = 2;
|
|
5
5
|
static readonly LINE_COMMENT = 3;
|
|
6
6
|
static readonly KW_ABS = 4;
|
|
7
7
|
static readonly KW_ALL = 5;
|
|
@@ -23,8 +23,8 @@ export class FlinkSqlLexer extends antlr.Lexer {
|
|
|
23
23
|
return FlinkSqlLexer.vocabulary;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
FlinkSqlLexer.
|
|
27
|
-
FlinkSqlLexer.
|
|
26
|
+
FlinkSqlLexer.WHITE_SPACE = 1;
|
|
27
|
+
FlinkSqlLexer.BRACKETED_COMMENT = 2;
|
|
28
28
|
FlinkSqlLexer.LINE_COMMENT = 3;
|
|
29
29
|
FlinkSqlLexer.KW_ABS = 4;
|
|
30
30
|
FlinkSqlLexer.KW_ALL = 5;
|
|
@@ -669,21 +669,22 @@ FlinkSqlLexer.literalNames = [
|
|
|
669
669
|
"'_'", "'-'", "'+'", "'%'", "'||'", "'--'", "'/'", "'?'", "'=>'"
|
|
670
670
|
];
|
|
671
671
|
FlinkSqlLexer.symbolicNames = [
|
|
672
|
-
null, "
|
|
673
|
-
"KW_ALLOCATE", "KW_ALLOW", "KW_ALTER", "KW_ANALYZE", "KW_AND",
|
|
674
|
-
"KW_ARE", "KW_ARRAY", "KW_ARRAY_AGG", "KW_ARRAY_CONCAT_AGG",
|
|
675
|
-
"
|
|
676
|
-
"
|
|
677
|
-
"
|
|
678
|
-
"
|
|
679
|
-
"
|
|
680
|
-
"
|
|
681
|
-
"
|
|
682
|
-
"
|
|
683
|
-
"
|
|
684
|
-
"
|
|
685
|
-
"
|
|
686
|
-
"
|
|
672
|
+
null, "WHITE_SPACE", "BRACKETED_COMMENT", "LINE_COMMENT", "KW_ABS",
|
|
673
|
+
"KW_ALL", "KW_ALLOCATE", "KW_ALLOW", "KW_ALTER", "KW_ANALYZE", "KW_AND",
|
|
674
|
+
"KW_ANY", "KW_ARE", "KW_ARRAY", "KW_ARRAY_AGG", "KW_ARRAY_CONCAT_AGG",
|
|
675
|
+
"KW_ARRAY_MAX_CARDINALITY", "KW_AS", "KW_ASENSITIVE", "KW_ASYMMETRIC",
|
|
676
|
+
"KW_AT", "KW_ATOMIC", "KW_AUTHORIZATION", "KW_AVG", "KW_BEGIN",
|
|
677
|
+
"KW_BEGIN_FRAME", "KW_BEGIN_PARTITION", "KW_BETWEEN", "KW_BIGINT",
|
|
678
|
+
"KW_BINARY", "KW_BIT", "KW_BLOB", "KW_BOOLEAN", "KW_BOTH", "KW_BY",
|
|
679
|
+
"KW_BYTES", "KW_CALL", "KW_CALLED", "KW_CARDINALITY", "KW_CASCADED",
|
|
680
|
+
"KW_CASE", "KW_CAST", "KW_CATALOGS", "KW_CEIL", "KW_CEILING", "KW_CHANGELOG_MODE",
|
|
681
|
+
"KW_CHAR", "KW_CHARACTER", "KW_CHARACTER_LENGTH", "KW_CHAR_LENGTH",
|
|
682
|
+
"KW_CHECK", "KW_CLASSIFIER", "KW_CLOB", "KW_CLOSE", "KW_COALESCE",
|
|
683
|
+
"KW_COLLATE", "KW_COLLECT", "KW_COLUMN", "KW_COLUMNS", "KW_COMMENT",
|
|
684
|
+
"KW_COMMIT", "KW_COMPUTE", "KW_CONDITION", "KW_CONNECT", "KW_CONSTRAINT",
|
|
685
|
+
"KW_CONTAINS", "KW_CONVERT", "KW_CORR", "KW_CORRESPONDING", "KW_COUNT",
|
|
686
|
+
"KW_COVAR_POP", "KW_COVAR_SAMP", "KW_CREATE", "KW_CROSS", "KW_CUBE",
|
|
687
|
+
"KW_CUME_DIST", "KW_CURRENT", "KW_CURRENT_CATALOG", "KW_CURRENT_DATE",
|
|
687
688
|
"KW_CURRENT_DEFAULT_TRANSFORM_GROUP", "KW_CURRENT_PATH", "KW_CURRENT_ROLE",
|
|
688
689
|
"KW_CURRENT_ROW", "KW_CURRENT_SCHEMA", "KW_CURRENT_TIME", "KW_CURRENT_TIMESTAMP",
|
|
689
690
|
"KW_CURRENT_TRANSFORM_GROUP_FOR_TYPE", "KW_CURRENT_USER", "KW_CURSOR",
|
|
@@ -782,9 +783,9 @@ FlinkSqlLexer.modeNames = [
|
|
|
782
783
|
"DEFAULT_MODE",
|
|
783
784
|
];
|
|
784
785
|
FlinkSqlLexer.ruleNames = [
|
|
785
|
-
"
|
|
786
|
-
"KW_ALLOW", "KW_ALTER", "KW_ANALYZE", "KW_AND", "KW_ANY",
|
|
787
|
-
"KW_ARRAY", "KW_ARRAY_AGG", "KW_ARRAY_CONCAT_AGG", "KW_ARRAY_MAX_CARDINALITY",
|
|
786
|
+
"WHITE_SPACE", "BRACKETED_COMMENT", "LINE_COMMENT", "KW_ABS", "KW_ALL",
|
|
787
|
+
"KW_ALLOCATE", "KW_ALLOW", "KW_ALTER", "KW_ANALYZE", "KW_AND", "KW_ANY",
|
|
788
|
+
"KW_ARE", "KW_ARRAY", "KW_ARRAY_AGG", "KW_ARRAY_CONCAT_AGG", "KW_ARRAY_MAX_CARDINALITY",
|
|
788
789
|
"KW_AS", "KW_ASENSITIVE", "KW_ASYMMETRIC", "KW_AT", "KW_ATOMIC",
|
|
789
790
|
"KW_AUTHORIZATION", "KW_AVG", "KW_BEGIN", "KW_BEGIN_FRAME", "KW_BEGIN_PARTITION",
|
|
790
791
|
"KW_BETWEEN", "KW_BIGINT", "KW_BINARY", "KW_BIT", "KW_BLOB", "KW_BOOLEAN",
|
|
@@ -4,8 +4,8 @@ import { FlinkSqlParserListener } from "./FlinkSqlParserListener.js";
|
|
|
4
4
|
import { FlinkSqlParserVisitor } from "./FlinkSqlParserVisitor.js";
|
|
5
5
|
import { SQLParserBase } from '../SQLParserBase';
|
|
6
6
|
export declare class FlinkSqlParser extends SQLParserBase {
|
|
7
|
-
static readonly
|
|
8
|
-
static readonly
|
|
7
|
+
static readonly WHITE_SPACE = 1;
|
|
8
|
+
static readonly BRACKETED_COMMENT = 2;
|
|
9
9
|
static readonly LINE_COMMENT = 3;
|
|
10
10
|
static readonly KW_ABS = 4;
|
|
11
11
|
static readonly KW_ALL = 5;
|
|
@@ -573,171 +573,172 @@ export declare class FlinkSqlParser extends SQLParserBase {
|
|
|
573
573
|
static readonly RULE_physicalColumnDefinition = 24;
|
|
574
574
|
static readonly RULE_columnNameCreate = 25;
|
|
575
575
|
static readonly RULE_columnName = 26;
|
|
576
|
-
static readonly
|
|
577
|
-
static readonly
|
|
578
|
-
static readonly
|
|
579
|
-
static readonly
|
|
580
|
-
static readonly
|
|
581
|
-
static readonly
|
|
582
|
-
static readonly
|
|
583
|
-
static readonly
|
|
584
|
-
static readonly
|
|
585
|
-
static readonly
|
|
586
|
-
static readonly
|
|
587
|
-
static readonly
|
|
588
|
-
static readonly
|
|
589
|
-
static readonly
|
|
590
|
-
static readonly
|
|
591
|
-
static readonly
|
|
592
|
-
static readonly
|
|
593
|
-
static readonly
|
|
594
|
-
static readonly
|
|
595
|
-
static readonly
|
|
596
|
-
static readonly
|
|
597
|
-
static readonly
|
|
598
|
-
static readonly
|
|
599
|
-
static readonly
|
|
600
|
-
static readonly
|
|
601
|
-
static readonly
|
|
602
|
-
static readonly
|
|
603
|
-
static readonly
|
|
604
|
-
static readonly
|
|
605
|
-
static readonly
|
|
606
|
-
static readonly
|
|
607
|
-
static readonly
|
|
608
|
-
static readonly
|
|
609
|
-
static readonly
|
|
610
|
-
static readonly
|
|
611
|
-
static readonly
|
|
612
|
-
static readonly
|
|
613
|
-
static readonly
|
|
614
|
-
static readonly
|
|
615
|
-
static readonly
|
|
616
|
-
static readonly
|
|
617
|
-
static readonly
|
|
618
|
-
static readonly
|
|
619
|
-
static readonly
|
|
620
|
-
static readonly
|
|
621
|
-
static readonly
|
|
622
|
-
static readonly
|
|
623
|
-
static readonly
|
|
624
|
-
static readonly
|
|
625
|
-
static readonly
|
|
626
|
-
static readonly
|
|
627
|
-
static readonly
|
|
628
|
-
static readonly
|
|
629
|
-
static readonly
|
|
630
|
-
static readonly
|
|
631
|
-
static readonly
|
|
632
|
-
static readonly
|
|
633
|
-
static readonly
|
|
634
|
-
static readonly
|
|
635
|
-
static readonly
|
|
636
|
-
static readonly
|
|
637
|
-
static readonly
|
|
638
|
-
static readonly
|
|
639
|
-
static readonly
|
|
640
|
-
static readonly
|
|
641
|
-
static readonly
|
|
642
|
-
static readonly
|
|
643
|
-
static readonly
|
|
644
|
-
static readonly
|
|
645
|
-
static readonly
|
|
646
|
-
static readonly
|
|
647
|
-
static readonly
|
|
648
|
-
static readonly
|
|
649
|
-
static readonly
|
|
650
|
-
static readonly
|
|
651
|
-
static readonly
|
|
652
|
-
static readonly
|
|
653
|
-
static readonly
|
|
654
|
-
static readonly
|
|
655
|
-
static readonly
|
|
656
|
-
static readonly
|
|
657
|
-
static readonly
|
|
658
|
-
static readonly
|
|
659
|
-
static readonly
|
|
660
|
-
static readonly
|
|
661
|
-
static readonly
|
|
662
|
-
static readonly
|
|
663
|
-
static readonly
|
|
664
|
-
static readonly
|
|
665
|
-
static readonly
|
|
666
|
-
static readonly
|
|
667
|
-
static readonly
|
|
668
|
-
static readonly
|
|
669
|
-
static readonly
|
|
670
|
-
static readonly
|
|
671
|
-
static readonly
|
|
672
|
-
static readonly
|
|
673
|
-
static readonly
|
|
674
|
-
static readonly
|
|
675
|
-
static readonly
|
|
676
|
-
static readonly
|
|
677
|
-
static readonly
|
|
678
|
-
static readonly
|
|
679
|
-
static readonly
|
|
680
|
-
static readonly
|
|
681
|
-
static readonly
|
|
682
|
-
static readonly
|
|
683
|
-
static readonly
|
|
684
|
-
static readonly
|
|
685
|
-
static readonly
|
|
686
|
-
static readonly
|
|
687
|
-
static readonly
|
|
688
|
-
static readonly
|
|
689
|
-
static readonly
|
|
690
|
-
static readonly
|
|
691
|
-
static readonly
|
|
692
|
-
static readonly
|
|
693
|
-
static readonly
|
|
694
|
-
static readonly
|
|
695
|
-
static readonly
|
|
696
|
-
static readonly
|
|
697
|
-
static readonly
|
|
698
|
-
static readonly
|
|
699
|
-
static readonly
|
|
700
|
-
static readonly
|
|
701
|
-
static readonly
|
|
702
|
-
static readonly
|
|
703
|
-
static readonly
|
|
704
|
-
static readonly
|
|
705
|
-
static readonly
|
|
706
|
-
static readonly
|
|
707
|
-
static readonly
|
|
708
|
-
static readonly
|
|
709
|
-
static readonly
|
|
710
|
-
static readonly
|
|
711
|
-
static readonly
|
|
712
|
-
static readonly
|
|
713
|
-
static readonly
|
|
714
|
-
static readonly
|
|
715
|
-
static readonly
|
|
716
|
-
static readonly
|
|
717
|
-
static readonly
|
|
718
|
-
static readonly
|
|
719
|
-
static readonly
|
|
720
|
-
static readonly
|
|
721
|
-
static readonly
|
|
722
|
-
static readonly
|
|
723
|
-
static readonly
|
|
724
|
-
static readonly
|
|
725
|
-
static readonly
|
|
726
|
-
static readonly
|
|
727
|
-
static readonly
|
|
728
|
-
static readonly
|
|
729
|
-
static readonly
|
|
730
|
-
static readonly
|
|
731
|
-
static readonly
|
|
732
|
-
static readonly
|
|
733
|
-
static readonly
|
|
734
|
-
static readonly
|
|
735
|
-
static readonly
|
|
736
|
-
static readonly
|
|
737
|
-
static readonly
|
|
738
|
-
static readonly
|
|
739
|
-
static readonly
|
|
740
|
-
static readonly
|
|
576
|
+
static readonly RULE_columnNamePath = 27;
|
|
577
|
+
static readonly RULE_columnNameList = 28;
|
|
578
|
+
static readonly RULE_columnType = 29;
|
|
579
|
+
static readonly RULE_lengthOneDimension = 30;
|
|
580
|
+
static readonly RULE_lengthTwoOptionalDimension = 31;
|
|
581
|
+
static readonly RULE_lengthTwoStringDimension = 32;
|
|
582
|
+
static readonly RULE_lengthOneTypeDimension = 33;
|
|
583
|
+
static readonly RULE_mapTypeDimension = 34;
|
|
584
|
+
static readonly RULE_rowTypeDimension = 35;
|
|
585
|
+
static readonly RULE_columnConstraint = 36;
|
|
586
|
+
static readonly RULE_metadataColumnDefinition = 37;
|
|
587
|
+
static readonly RULE_metadataKey = 38;
|
|
588
|
+
static readonly RULE_computedColumnDefinition = 39;
|
|
589
|
+
static readonly RULE_computedColumnExpression = 40;
|
|
590
|
+
static readonly RULE_watermarkDefinition = 41;
|
|
591
|
+
static readonly RULE_tableConstraint = 42;
|
|
592
|
+
static readonly RULE_constraintName = 43;
|
|
593
|
+
static readonly RULE_selfDefinitionClause = 44;
|
|
594
|
+
static readonly RULE_partitionDefinition = 45;
|
|
595
|
+
static readonly RULE_transformList = 46;
|
|
596
|
+
static readonly RULE_transform = 47;
|
|
597
|
+
static readonly RULE_transformArgument = 48;
|
|
598
|
+
static readonly RULE_likeDefinition = 49;
|
|
599
|
+
static readonly RULE_likeOption = 50;
|
|
600
|
+
static readonly RULE_createCatalog = 51;
|
|
601
|
+
static readonly RULE_createDatabase = 52;
|
|
602
|
+
static readonly RULE_createView = 53;
|
|
603
|
+
static readonly RULE_createFunction = 54;
|
|
604
|
+
static readonly RULE_usingClause = 55;
|
|
605
|
+
static readonly RULE_jarFileName = 56;
|
|
606
|
+
static readonly RULE_alterTable = 57;
|
|
607
|
+
static readonly RULE_renameDefinition = 58;
|
|
608
|
+
static readonly RULE_setKeyValueDefinition = 59;
|
|
609
|
+
static readonly RULE_addConstraint = 60;
|
|
610
|
+
static readonly RULE_dropConstraint = 61;
|
|
611
|
+
static readonly RULE_addUnique = 62;
|
|
612
|
+
static readonly RULE_notForced = 63;
|
|
613
|
+
static readonly RULE_alterView = 64;
|
|
614
|
+
static readonly RULE_alterDatabase = 65;
|
|
615
|
+
static readonly RULE_alterFunction = 66;
|
|
616
|
+
static readonly RULE_dropCatalog = 67;
|
|
617
|
+
static readonly RULE_dropTable = 68;
|
|
618
|
+
static readonly RULE_dropDatabase = 69;
|
|
619
|
+
static readonly RULE_dropView = 70;
|
|
620
|
+
static readonly RULE_dropFunction = 71;
|
|
621
|
+
static readonly RULE_insertStatement = 72;
|
|
622
|
+
static readonly RULE_insertSimpleStatement = 73;
|
|
623
|
+
static readonly RULE_insertPartitionDefinition = 74;
|
|
624
|
+
static readonly RULE_valuesDefinition = 75;
|
|
625
|
+
static readonly RULE_valuesRowDefinition = 76;
|
|
626
|
+
static readonly RULE_insertMulStatementCompatibility = 77;
|
|
627
|
+
static readonly RULE_insertMulStatement = 78;
|
|
628
|
+
static readonly RULE_queryStatement = 79;
|
|
629
|
+
static readonly RULE_valuesClause = 80;
|
|
630
|
+
static readonly RULE_withClause = 81;
|
|
631
|
+
static readonly RULE_withItem = 82;
|
|
632
|
+
static readonly RULE_withItemName = 83;
|
|
633
|
+
static readonly RULE_selectStatement = 84;
|
|
634
|
+
static readonly RULE_selectClause = 85;
|
|
635
|
+
static readonly RULE_projectItemDefinition = 86;
|
|
636
|
+
static readonly RULE_overWindowItem = 87;
|
|
637
|
+
static readonly RULE_fromClause = 88;
|
|
638
|
+
static readonly RULE_tableExpression = 89;
|
|
639
|
+
static readonly RULE_tableReference = 90;
|
|
640
|
+
static readonly RULE_tablePrimary = 91;
|
|
641
|
+
static readonly RULE_systemTimePeriod = 92;
|
|
642
|
+
static readonly RULE_dateTimeExpression = 93;
|
|
643
|
+
static readonly RULE_inlineDataValueClause = 94;
|
|
644
|
+
static readonly RULE_windowTVFClause = 95;
|
|
645
|
+
static readonly RULE_windowTVFExpression = 96;
|
|
646
|
+
static readonly RULE_windowTVFName = 97;
|
|
647
|
+
static readonly RULE_windowTVFParam = 98;
|
|
648
|
+
static readonly RULE_timeIntervalParamName = 99;
|
|
649
|
+
static readonly RULE_columnDescriptor = 100;
|
|
650
|
+
static readonly RULE_joinCondition = 101;
|
|
651
|
+
static readonly RULE_whereClause = 102;
|
|
652
|
+
static readonly RULE_groupByClause = 103;
|
|
653
|
+
static readonly RULE_groupItemDefinition = 104;
|
|
654
|
+
static readonly RULE_groupingSets = 105;
|
|
655
|
+
static readonly RULE_groupingSetsNotationName = 106;
|
|
656
|
+
static readonly RULE_groupWindowFunction = 107;
|
|
657
|
+
static readonly RULE_groupWindowFunctionName = 108;
|
|
658
|
+
static readonly RULE_timeAttrColumn = 109;
|
|
659
|
+
static readonly RULE_havingClause = 110;
|
|
660
|
+
static readonly RULE_windowClause = 111;
|
|
661
|
+
static readonly RULE_namedWindow = 112;
|
|
662
|
+
static readonly RULE_windowSpec = 113;
|
|
663
|
+
static readonly RULE_matchRecognizeClause = 114;
|
|
664
|
+
static readonly RULE_orderByClause = 115;
|
|
665
|
+
static readonly RULE_orderItemDefinition = 116;
|
|
666
|
+
static readonly RULE_limitClause = 117;
|
|
667
|
+
static readonly RULE_partitionByClause = 118;
|
|
668
|
+
static readonly RULE_quantifiers = 119;
|
|
669
|
+
static readonly RULE_measuresClause = 120;
|
|
670
|
+
static readonly RULE_patternDefinition = 121;
|
|
671
|
+
static readonly RULE_patternVariable = 122;
|
|
672
|
+
static readonly RULE_outputMode = 123;
|
|
673
|
+
static readonly RULE_afterMatchStrategy = 124;
|
|
674
|
+
static readonly RULE_patternVariablesDefinition = 125;
|
|
675
|
+
static readonly RULE_windowFrame = 126;
|
|
676
|
+
static readonly RULE_frameBound = 127;
|
|
677
|
+
static readonly RULE_withinClause = 128;
|
|
678
|
+
static readonly RULE_expression = 129;
|
|
679
|
+
static readonly RULE_booleanExpression = 130;
|
|
680
|
+
static readonly RULE_predicate = 131;
|
|
681
|
+
static readonly RULE_likePredicate = 132;
|
|
682
|
+
static readonly RULE_valueExpression = 133;
|
|
683
|
+
static readonly RULE_functionCallExpression = 134;
|
|
684
|
+
static readonly RULE_primaryExpression = 135;
|
|
685
|
+
static readonly RULE_functionNameCreate = 136;
|
|
686
|
+
static readonly RULE_functionName = 137;
|
|
687
|
+
static readonly RULE_functionNameAndParams = 138;
|
|
688
|
+
static readonly RULE_functionNameWithParams = 139;
|
|
689
|
+
static readonly RULE_functionParam = 140;
|
|
690
|
+
static readonly RULE_dereferenceDefinition = 141;
|
|
691
|
+
static readonly RULE_correlationName = 142;
|
|
692
|
+
static readonly RULE_qualifiedName = 143;
|
|
693
|
+
static readonly RULE_timeIntervalExpression = 144;
|
|
694
|
+
static readonly RULE_errorCapturingMultiUnitsInterval = 145;
|
|
695
|
+
static readonly RULE_multiUnitsInterval = 146;
|
|
696
|
+
static readonly RULE_errorCapturingUnitToUnitInterval = 147;
|
|
697
|
+
static readonly RULE_unitToUnitInterval = 148;
|
|
698
|
+
static readonly RULE_intervalValue = 149;
|
|
699
|
+
static readonly RULE_tableAlias = 150;
|
|
700
|
+
static readonly RULE_errorCapturingIdentifier = 151;
|
|
701
|
+
static readonly RULE_errorCapturingIdentifierExtra = 152;
|
|
702
|
+
static readonly RULE_identifierList = 153;
|
|
703
|
+
static readonly RULE_identifierSeq = 154;
|
|
704
|
+
static readonly RULE_identifier = 155;
|
|
705
|
+
static readonly RULE_unquotedIdentifier = 156;
|
|
706
|
+
static readonly RULE_quotedIdentifier = 157;
|
|
707
|
+
static readonly RULE_whenClause = 158;
|
|
708
|
+
static readonly RULE_catalogPath = 159;
|
|
709
|
+
static readonly RULE_catalogPathCreate = 160;
|
|
710
|
+
static readonly RULE_databasePath = 161;
|
|
711
|
+
static readonly RULE_databasePathCreate = 162;
|
|
712
|
+
static readonly RULE_tablePathCreate = 163;
|
|
713
|
+
static readonly RULE_tablePath = 164;
|
|
714
|
+
static readonly RULE_viewPath = 165;
|
|
715
|
+
static readonly RULE_viewPathCreate = 166;
|
|
716
|
+
static readonly RULE_uid = 167;
|
|
717
|
+
static readonly RULE_withOption = 168;
|
|
718
|
+
static readonly RULE_ifNotExists = 169;
|
|
719
|
+
static readonly RULE_ifExists = 170;
|
|
720
|
+
static readonly RULE_tablePropertyList = 171;
|
|
721
|
+
static readonly RULE_tableProperty = 172;
|
|
722
|
+
static readonly RULE_tablePropertyKey = 173;
|
|
723
|
+
static readonly RULE_tablePropertyValue = 174;
|
|
724
|
+
static readonly RULE_logicalOperator = 175;
|
|
725
|
+
static readonly RULE_comparisonOperator = 176;
|
|
726
|
+
static readonly RULE_bitOperator = 177;
|
|
727
|
+
static readonly RULE_mathOperator = 178;
|
|
728
|
+
static readonly RULE_unaryOperator = 179;
|
|
729
|
+
static readonly RULE_constant = 180;
|
|
730
|
+
static readonly RULE_timePointLiteral = 181;
|
|
731
|
+
static readonly RULE_stringLiteral = 182;
|
|
732
|
+
static readonly RULE_decimalLiteral = 183;
|
|
733
|
+
static readonly RULE_booleanLiteral = 184;
|
|
734
|
+
static readonly RULE_setQuantifier = 185;
|
|
735
|
+
static readonly RULE_timePointUnit = 186;
|
|
736
|
+
static readonly RULE_timeIntervalUnit = 187;
|
|
737
|
+
static readonly RULE_reservedKeywordsUsedAsFuncParam = 188;
|
|
738
|
+
static readonly RULE_reservedKeywordsNoParamsUsedAsFuncName = 189;
|
|
739
|
+
static readonly RULE_reservedKeywordsFollowParamsUsedAsFuncName = 190;
|
|
740
|
+
static readonly RULE_reservedKeywordsUsedAsFuncName = 191;
|
|
741
|
+
static readonly RULE_nonReservedKeywords = 192;
|
|
741
742
|
static readonly literalNames: (string | null)[];
|
|
742
743
|
static readonly symbolicNames: (string | null)[];
|
|
743
744
|
static readonly ruleNames: string[];
|
|
@@ -775,6 +776,7 @@ export declare class FlinkSqlParser extends SQLParserBase {
|
|
|
775
776
|
physicalColumnDefinition(): PhysicalColumnDefinitionContext;
|
|
776
777
|
columnNameCreate(): ColumnNameCreateContext;
|
|
777
778
|
columnName(): ColumnNameContext;
|
|
779
|
+
columnNamePath(): ColumnNamePathContext;
|
|
778
780
|
columnNameList(): ColumnNameListContext;
|
|
779
781
|
columnType(): ColumnTypeContext;
|
|
780
782
|
lengthOneDimension(): LengthOneDimensionContext;
|
|
@@ -1314,6 +1316,14 @@ export declare class ColumnNameContext extends antlr.ParserRuleContext {
|
|
|
1314
1316
|
exitRule(listener: FlinkSqlParserListener): void;
|
|
1315
1317
|
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
1316
1318
|
}
|
|
1319
|
+
export declare class ColumnNamePathContext extends antlr.ParserRuleContext {
|
|
1320
|
+
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
1321
|
+
uid(): UidContext;
|
|
1322
|
+
get ruleIndex(): number;
|
|
1323
|
+
enterRule(listener: FlinkSqlParserListener): void;
|
|
1324
|
+
exitRule(listener: FlinkSqlParserListener): void;
|
|
1325
|
+
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
1326
|
+
}
|
|
1317
1327
|
export declare class ColumnNameListContext extends antlr.ParserRuleContext {
|
|
1318
1328
|
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
1319
1329
|
LR_BRACKET(): antlr.TerminalNode;
|
|
@@ -2861,7 +2871,7 @@ export declare class SimpleCaseContext extends PrimaryExpressionContext {
|
|
|
2861
2871
|
}
|
|
2862
2872
|
export declare class ColumnReferenceContext extends PrimaryExpressionContext {
|
|
2863
2873
|
constructor(ctx: PrimaryExpressionContext);
|
|
2864
|
-
|
|
2874
|
+
columnNamePath(): ColumnNamePathContext;
|
|
2865
2875
|
enterRule(listener: FlinkSqlParserListener): void;
|
|
2866
2876
|
exitRule(listener: FlinkSqlParserListener): void;
|
|
2867
2877
|
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|