dt-sql-parser 4.1.2-beta.1 → 4.3.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.
Files changed (83) hide show
  1. package/README.md +51 -0
  2. package/dist/lib/flink/FlinkSqlLexer.d.ts +2 -2
  3. package/dist/lib/flink/FlinkSqlLexer.js +21 -20
  4. package/dist/lib/flink/FlinkSqlParser.d.ts +178 -168
  5. package/dist/lib/flink/FlinkSqlParser.js +2799 -2741
  6. package/dist/lib/flink/FlinkSqlParserListener.d.ts +11 -0
  7. package/dist/lib/flink/FlinkSqlParserVisitor.d.ts +7 -0
  8. package/dist/lib/hive/HiveSqlParser.d.ts +241 -221
  9. package/dist/lib/hive/HiveSqlParser.js +6229 -5639
  10. package/dist/lib/hive/HiveSqlParserListener.d.ts +22 -0
  11. package/dist/lib/hive/HiveSqlParserVisitor.d.ts +14 -0
  12. package/dist/lib/impala/ImpalaSqlLexer.d.ts +2 -2
  13. package/dist/lib/impala/ImpalaSqlLexer.js +5 -5
  14. package/dist/lib/impala/ImpalaSqlParser.d.ts +147 -109
  15. package/dist/lib/impala/ImpalaSqlParser.js +3448 -3234
  16. package/dist/lib/impala/ImpalaSqlParserListener.d.ts +44 -0
  17. package/dist/lib/impala/ImpalaSqlParserVisitor.d.ts +28 -0
  18. package/dist/lib/mysql/MySqlLexer.d.ts +2 -2
  19. package/dist/lib/mysql/MySqlLexer.js +43 -43
  20. package/dist/lib/mysql/MySqlParser.d.ts +2 -2
  21. package/dist/lib/mysql/MySqlParser.js +42 -42
  22. package/dist/lib/postgresql/PostgreSqlLexer.d.ts +14 -15
  23. package/dist/lib/postgresql/PostgreSqlLexer.js +2077 -2092
  24. package/dist/lib/postgresql/PostgreSqlParser.d.ts +152 -131
  25. package/dist/lib/postgresql/PostgreSqlParser.js +10052 -9925
  26. package/dist/lib/postgresql/PostgreSqlParserListener.d.ts +22 -0
  27. package/dist/lib/postgresql/PostgreSqlParserVisitor.d.ts +14 -0
  28. package/dist/lib/spark/SparkSqlLexer.d.ts +2 -2
  29. package/dist/lib/spark/SparkSqlLexer.js +6 -6
  30. package/dist/lib/spark/SparkSqlParser.d.ts +391 -623
  31. package/dist/lib/spark/SparkSqlParser.js +6749 -8109
  32. package/dist/lib/spark/SparkSqlParserListener.d.ts +38 -326
  33. package/dist/lib/spark/SparkSqlParserVisitor.d.ts +24 -207
  34. package/dist/lib/trino/TrinoSqlLexer.d.ts +2 -2
  35. package/dist/lib/trino/TrinoSqlLexer.js +5 -5
  36. package/dist/lib/trino/TrinoSqlListener.d.ts +44 -0
  37. package/dist/lib/trino/TrinoSqlParser.d.ts +182 -153
  38. package/dist/lib/trino/TrinoSqlParser.js +4758 -4599
  39. package/dist/lib/trino/TrinoSqlVisitor.d.ts +28 -0
  40. package/dist/parser/common/basicSQL.d.ts +43 -9
  41. package/dist/parser/common/basicSQL.js +147 -40
  42. package/dist/parser/common/semanticContextCollector.d.ts +50 -0
  43. package/dist/parser/common/semanticContextCollector.js +202 -0
  44. package/dist/parser/common/tokenUtils.d.ts +12 -0
  45. package/dist/parser/common/tokenUtils.js +38 -0
  46. package/dist/parser/common/types.d.ts +30 -1
  47. package/dist/parser/common/types.js +11 -0
  48. package/dist/parser/flink/flinkErrorListener.js +14 -2
  49. package/dist/parser/flink/flinkSemanticContextCollector.d.ts +9 -0
  50. package/dist/parser/flink/flinkSemanticContextCollector.js +14 -0
  51. package/dist/parser/flink/index.d.ts +4 -2
  52. package/dist/parser/flink/index.js +32 -14
  53. package/dist/parser/hive/hiveErrorListener.js +9 -3
  54. package/dist/parser/hive/hiveSemanticContextCollector.d.ts +9 -0
  55. package/dist/parser/hive/hiveSemanticContextCollector.js +14 -0
  56. package/dist/parser/hive/index.d.ts +4 -2
  57. package/dist/parser/hive/index.js +29 -14
  58. package/dist/parser/impala/ImpalaErrorListener.js +8 -2
  59. package/dist/parser/impala/impalaSemanticContextCollector.d.ts +9 -0
  60. package/dist/parser/impala/impalaSemanticContextCollector.js +14 -0
  61. package/dist/parser/impala/index.d.ts +4 -2
  62. package/dist/parser/impala/index.js +21 -14
  63. package/dist/parser/mysql/index.d.ts +4 -2
  64. package/dist/parser/mysql/index.js +10 -14
  65. package/dist/parser/mysql/mysqlErrorListener.js +6 -2
  66. package/dist/parser/mysql/mysqlSemanticContextCollector.d.ts +9 -0
  67. package/dist/parser/mysql/mysqlSemanticContextCollector.js +14 -0
  68. package/dist/parser/postgresql/index.d.ts +4 -2
  69. package/dist/parser/postgresql/index.js +23 -14
  70. package/dist/parser/postgresql/postgreErrorListener.js +9 -3
  71. package/dist/parser/postgresql/postgreSemanticContextCollector.d.ts +9 -0
  72. package/dist/parser/postgresql/postgreSemanticContextCollector.js +14 -0
  73. package/dist/parser/spark/index.d.ts +4 -2
  74. package/dist/parser/spark/index.js +26 -14
  75. package/dist/parser/spark/sparkErrorListener.js +9 -3
  76. package/dist/parser/spark/sparkSemanticContextCollector.d.ts +9 -0
  77. package/dist/parser/spark/sparkSemanticContextCollector.js +14 -0
  78. package/dist/parser/trino/index.d.ts +4 -2
  79. package/dist/parser/trino/index.js +22 -14
  80. package/dist/parser/trino/trinoErrorListener.js +9 -3
  81. package/dist/parser/trino/trinoSemanticContextCollector.d.ts +9 -0
  82. package/dist/parser/trino/trinoSemanticContextCollector.js +14 -0
  83. 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 SPACE = 1;
4
- static readonly COMMENT_INPUT = 2;
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.SPACE = 1;
27
- FlinkSqlLexer.COMMENT_INPUT = 2;
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, "SPACE", "COMMENT_INPUT", "LINE_COMMENT", "KW_ABS", "KW_ALL",
673
- "KW_ALLOCATE", "KW_ALLOW", "KW_ALTER", "KW_ANALYZE", "KW_AND", "KW_ANY",
674
- "KW_ARE", "KW_ARRAY", "KW_ARRAY_AGG", "KW_ARRAY_CONCAT_AGG", "KW_ARRAY_MAX_CARDINALITY",
675
- "KW_AS", "KW_ASENSITIVE", "KW_ASYMMETRIC", "KW_AT", "KW_ATOMIC",
676
- "KW_AUTHORIZATION", "KW_AVG", "KW_BEGIN", "KW_BEGIN_FRAME", "KW_BEGIN_PARTITION",
677
- "KW_BETWEEN", "KW_BIGINT", "KW_BINARY", "KW_BIT", "KW_BLOB", "KW_BOOLEAN",
678
- "KW_BOTH", "KW_BY", "KW_BYTES", "KW_CALL", "KW_CALLED", "KW_CARDINALITY",
679
- "KW_CASCADED", "KW_CASE", "KW_CAST", "KW_CATALOGS", "KW_CEIL", "KW_CEILING",
680
- "KW_CHANGELOG_MODE", "KW_CHAR", "KW_CHARACTER", "KW_CHARACTER_LENGTH",
681
- "KW_CHAR_LENGTH", "KW_CHECK", "KW_CLASSIFIER", "KW_CLOB", "KW_CLOSE",
682
- "KW_COALESCE", "KW_COLLATE", "KW_COLLECT", "KW_COLUMN", "KW_COLUMNS",
683
- "KW_COMMENT", "KW_COMMIT", "KW_COMPUTE", "KW_CONDITION", "KW_CONNECT",
684
- "KW_CONSTRAINT", "KW_CONTAINS", "KW_CONVERT", "KW_CORR", "KW_CORRESPONDING",
685
- "KW_COUNT", "KW_COVAR_POP", "KW_COVAR_SAMP", "KW_CREATE", "KW_CROSS",
686
- "KW_CUBE", "KW_CUME_DIST", "KW_CURRENT", "KW_CURRENT_CATALOG", "KW_CURRENT_DATE",
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
- "SPACE", "COMMENT_INPUT", "LINE_COMMENT", "KW_ABS", "KW_ALL", "KW_ALLOCATE",
786
- "KW_ALLOW", "KW_ALTER", "KW_ANALYZE", "KW_AND", "KW_ANY", "KW_ARE",
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 SPACE = 1;
8
- static readonly COMMENT_INPUT = 2;
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 RULE_columnNameList = 27;
577
- static readonly RULE_columnType = 28;
578
- static readonly RULE_lengthOneDimension = 29;
579
- static readonly RULE_lengthTwoOptionalDimension = 30;
580
- static readonly RULE_lengthTwoStringDimension = 31;
581
- static readonly RULE_lengthOneTypeDimension = 32;
582
- static readonly RULE_mapTypeDimension = 33;
583
- static readonly RULE_rowTypeDimension = 34;
584
- static readonly RULE_columnConstraint = 35;
585
- static readonly RULE_metadataColumnDefinition = 36;
586
- static readonly RULE_metadataKey = 37;
587
- static readonly RULE_computedColumnDefinition = 38;
588
- static readonly RULE_computedColumnExpression = 39;
589
- static readonly RULE_watermarkDefinition = 40;
590
- static readonly RULE_tableConstraint = 41;
591
- static readonly RULE_constraintName = 42;
592
- static readonly RULE_selfDefinitionClause = 43;
593
- static readonly RULE_partitionDefinition = 44;
594
- static readonly RULE_transformList = 45;
595
- static readonly RULE_transform = 46;
596
- static readonly RULE_transformArgument = 47;
597
- static readonly RULE_likeDefinition = 48;
598
- static readonly RULE_likeOption = 49;
599
- static readonly RULE_createCatalog = 50;
600
- static readonly RULE_createDatabase = 51;
601
- static readonly RULE_createView = 52;
602
- static readonly RULE_createFunction = 53;
603
- static readonly RULE_usingClause = 54;
604
- static readonly RULE_jarFileName = 55;
605
- static readonly RULE_alterTable = 56;
606
- static readonly RULE_renameDefinition = 57;
607
- static readonly RULE_setKeyValueDefinition = 58;
608
- static readonly RULE_addConstraint = 59;
609
- static readonly RULE_dropConstraint = 60;
610
- static readonly RULE_addUnique = 61;
611
- static readonly RULE_notForced = 62;
612
- static readonly RULE_alterView = 63;
613
- static readonly RULE_alterDatabase = 64;
614
- static readonly RULE_alterFunction = 65;
615
- static readonly RULE_dropCatalog = 66;
616
- static readonly RULE_dropTable = 67;
617
- static readonly RULE_dropDatabase = 68;
618
- static readonly RULE_dropView = 69;
619
- static readonly RULE_dropFunction = 70;
620
- static readonly RULE_insertStatement = 71;
621
- static readonly RULE_insertSimpleStatement = 72;
622
- static readonly RULE_insertPartitionDefinition = 73;
623
- static readonly RULE_valuesDefinition = 74;
624
- static readonly RULE_valuesRowDefinition = 75;
625
- static readonly RULE_insertMulStatementCompatibility = 76;
626
- static readonly RULE_insertMulStatement = 77;
627
- static readonly RULE_queryStatement = 78;
628
- static readonly RULE_valuesClause = 79;
629
- static readonly RULE_withClause = 80;
630
- static readonly RULE_withItem = 81;
631
- static readonly RULE_withItemName = 82;
632
- static readonly RULE_selectStatement = 83;
633
- static readonly RULE_selectClause = 84;
634
- static readonly RULE_projectItemDefinition = 85;
635
- static readonly RULE_overWindowItem = 86;
636
- static readonly RULE_fromClause = 87;
637
- static readonly RULE_tableExpression = 88;
638
- static readonly RULE_tableReference = 89;
639
- static readonly RULE_tablePrimary = 90;
640
- static readonly RULE_systemTimePeriod = 91;
641
- static readonly RULE_dateTimeExpression = 92;
642
- static readonly RULE_inlineDataValueClause = 93;
643
- static readonly RULE_windowTVFClause = 94;
644
- static readonly RULE_windowTVFExpression = 95;
645
- static readonly RULE_windowTVFName = 96;
646
- static readonly RULE_windowTVFParam = 97;
647
- static readonly RULE_timeIntervalParamName = 98;
648
- static readonly RULE_columnDescriptor = 99;
649
- static readonly RULE_joinCondition = 100;
650
- static readonly RULE_whereClause = 101;
651
- static readonly RULE_groupByClause = 102;
652
- static readonly RULE_groupItemDefinition = 103;
653
- static readonly RULE_groupingSets = 104;
654
- static readonly RULE_groupingSetsNotationName = 105;
655
- static readonly RULE_groupWindowFunction = 106;
656
- static readonly RULE_groupWindowFunctionName = 107;
657
- static readonly RULE_timeAttrColumn = 108;
658
- static readonly RULE_havingClause = 109;
659
- static readonly RULE_windowClause = 110;
660
- static readonly RULE_namedWindow = 111;
661
- static readonly RULE_windowSpec = 112;
662
- static readonly RULE_matchRecognizeClause = 113;
663
- static readonly RULE_orderByClause = 114;
664
- static readonly RULE_orderItemDefinition = 115;
665
- static readonly RULE_limitClause = 116;
666
- static readonly RULE_partitionByClause = 117;
667
- static readonly RULE_quantifiers = 118;
668
- static readonly RULE_measuresClause = 119;
669
- static readonly RULE_patternDefinition = 120;
670
- static readonly RULE_patternVariable = 121;
671
- static readonly RULE_outputMode = 122;
672
- static readonly RULE_afterMatchStrategy = 123;
673
- static readonly RULE_patternVariablesDefinition = 124;
674
- static readonly RULE_windowFrame = 125;
675
- static readonly RULE_frameBound = 126;
676
- static readonly RULE_withinClause = 127;
677
- static readonly RULE_expression = 128;
678
- static readonly RULE_booleanExpression = 129;
679
- static readonly RULE_predicate = 130;
680
- static readonly RULE_likePredicate = 131;
681
- static readonly RULE_valueExpression = 132;
682
- static readonly RULE_functionCallExpression = 133;
683
- static readonly RULE_primaryExpression = 134;
684
- static readonly RULE_functionNameCreate = 135;
685
- static readonly RULE_functionName = 136;
686
- static readonly RULE_functionNameAndParams = 137;
687
- static readonly RULE_functionNameWithParams = 138;
688
- static readonly RULE_functionParam = 139;
689
- static readonly RULE_dereferenceDefinition = 140;
690
- static readonly RULE_correlationName = 141;
691
- static readonly RULE_qualifiedName = 142;
692
- static readonly RULE_timeIntervalExpression = 143;
693
- static readonly RULE_errorCapturingMultiUnitsInterval = 144;
694
- static readonly RULE_multiUnitsInterval = 145;
695
- static readonly RULE_errorCapturingUnitToUnitInterval = 146;
696
- static readonly RULE_unitToUnitInterval = 147;
697
- static readonly RULE_intervalValue = 148;
698
- static readonly RULE_tableAlias = 149;
699
- static readonly RULE_errorCapturingIdentifier = 150;
700
- static readonly RULE_errorCapturingIdentifierExtra = 151;
701
- static readonly RULE_identifierList = 152;
702
- static readonly RULE_identifierSeq = 153;
703
- static readonly RULE_identifier = 154;
704
- static readonly RULE_unquotedIdentifier = 155;
705
- static readonly RULE_quotedIdentifier = 156;
706
- static readonly RULE_whenClause = 157;
707
- static readonly RULE_catalogPath = 158;
708
- static readonly RULE_catalogPathCreate = 159;
709
- static readonly RULE_databasePath = 160;
710
- static readonly RULE_databasePathCreate = 161;
711
- static readonly RULE_tablePathCreate = 162;
712
- static readonly RULE_tablePath = 163;
713
- static readonly RULE_viewPath = 164;
714
- static readonly RULE_viewPathCreate = 165;
715
- static readonly RULE_uid = 166;
716
- static readonly RULE_withOption = 167;
717
- static readonly RULE_ifNotExists = 168;
718
- static readonly RULE_ifExists = 169;
719
- static readonly RULE_tablePropertyList = 170;
720
- static readonly RULE_tableProperty = 171;
721
- static readonly RULE_tablePropertyKey = 172;
722
- static readonly RULE_tablePropertyValue = 173;
723
- static readonly RULE_logicalOperator = 174;
724
- static readonly RULE_comparisonOperator = 175;
725
- static readonly RULE_bitOperator = 176;
726
- static readonly RULE_mathOperator = 177;
727
- static readonly RULE_unaryOperator = 178;
728
- static readonly RULE_constant = 179;
729
- static readonly RULE_timePointLiteral = 180;
730
- static readonly RULE_stringLiteral = 181;
731
- static readonly RULE_decimalLiteral = 182;
732
- static readonly RULE_booleanLiteral = 183;
733
- static readonly RULE_setQuantifier = 184;
734
- static readonly RULE_timePointUnit = 185;
735
- static readonly RULE_timeIntervalUnit = 186;
736
- static readonly RULE_reservedKeywordsUsedAsFuncParam = 187;
737
- static readonly RULE_reservedKeywordsNoParamsUsedAsFuncName = 188;
738
- static readonly RULE_reservedKeywordsFollowParamsUsedAsFuncName = 189;
739
- static readonly RULE_reservedKeywordsUsedAsFuncName = 190;
740
- static readonly RULE_nonReservedKeywords = 191;
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
- identifier(): IdentifierContext;
2874
+ columnNamePath(): ColumnNamePathContext;
2865
2875
  enterRule(listener: FlinkSqlParserListener): void;
2866
2876
  exitRule(listener: FlinkSqlParserListener): void;
2867
2877
  accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;