dt-sql-parser 4.5.0-beta.3 → 4.5.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 (69) hide show
  1. package/README.md +2 -1
  2. package/dist/index.d.ts +3 -2
  3. package/dist/index.js +2 -2
  4. package/dist/lib/SQLParserBase.d.ts +13 -1
  5. package/dist/lib/SQLParserBase.js +40 -5
  6. package/dist/lib/flink/FlinkSqlParser.d.ts +229 -186
  7. package/dist/lib/flink/FlinkSqlParser.js +3508 -3156
  8. package/dist/lib/flink/FlinkSqlParserListener.d.ts +33 -0
  9. package/dist/lib/flink/FlinkSqlParserVisitor.d.ts +21 -0
  10. package/dist/lib/generic/GenericSqlLexer.d.ts +143 -0
  11. package/dist/lib/generic/GenericSqlLexer.js +603 -0
  12. package/dist/lib/generic/GenericSqlListener.d.ts +1089 -0
  13. package/dist/lib/generic/GenericSqlListener.js +11 -0
  14. package/dist/lib/generic/GenericSqlParser.d.ts +1272 -0
  15. package/dist/lib/generic/GenericSqlParser.js +7641 -0
  16. package/dist/lib/generic/GenericSqlVisitor.d.ts +684 -0
  17. package/dist/lib/generic/GenericSqlVisitor.js +12 -0
  18. package/dist/lib/hive/HiveSqlParser.d.ts +274 -228
  19. package/dist/lib/hive/HiveSqlParser.js +6304 -5912
  20. package/dist/lib/hive/HiveSqlParserListener.d.ts +33 -0
  21. package/dist/lib/hive/HiveSqlParserVisitor.d.ts +21 -0
  22. package/dist/lib/impala/ImpalaSqlParser.d.ts +145 -103
  23. package/dist/lib/impala/ImpalaSqlParser.js +3687 -3320
  24. package/dist/lib/impala/ImpalaSqlParserListener.d.ts +33 -0
  25. package/dist/lib/impala/ImpalaSqlParserVisitor.d.ts +21 -0
  26. package/dist/lib/index.d.ts +2 -0
  27. package/dist/lib/index.js +2 -0
  28. package/dist/lib/mysql/MySqlParser.d.ts +161 -94
  29. package/dist/lib/mysql/MySqlParser.js +9959 -9499
  30. package/dist/lib/mysql/MySqlParserListener.d.ts +79 -5
  31. package/dist/lib/mysql/MySqlParserVisitor.d.ts +49 -3
  32. package/dist/lib/postgresql/PostgreSqlParser.d.ts +108 -71
  33. package/dist/lib/postgresql/PostgreSqlParser.js +13330 -10388
  34. package/dist/lib/postgresql/PostgreSqlParserListener.d.ts +48 -0
  35. package/dist/lib/postgresql/PostgreSqlParserVisitor.d.ts +30 -0
  36. package/dist/lib/spark/SparkSqlParser.d.ts +186 -146
  37. package/dist/lib/spark/SparkSqlParser.js +5368 -5095
  38. package/dist/lib/spark/SparkSqlParserListener.d.ts +33 -0
  39. package/dist/lib/spark/SparkSqlParserVisitor.d.ts +21 -0
  40. package/dist/lib/trino/TrinoSqlLexer.d.ts +297 -296
  41. package/dist/lib/trino/TrinoSqlLexer.js +1451 -1445
  42. package/dist/lib/trino/TrinoSqlListener.d.ts +13 -0
  43. package/dist/lib/trino/TrinoSqlParser.d.ts +308 -297
  44. package/dist/lib/trino/TrinoSqlParser.js +2381 -2300
  45. package/dist/lib/trino/TrinoSqlVisitor.d.ts +8 -0
  46. package/dist/parser/common/basicSQL.d.ts +5 -5
  47. package/dist/parser/common/basicSQL.js +3 -3
  48. package/dist/parser/common/entityCollector.js +14 -2
  49. package/dist/parser/flink/index.js +5 -2
  50. package/dist/parser/generic/genericEntityCollector.d.ts +30 -0
  51. package/dist/parser/generic/genericEntityCollector.js +116 -0
  52. package/dist/parser/generic/genericErrorListener.d.ts +6 -0
  53. package/dist/parser/generic/genericErrorListener.js +56 -0
  54. package/dist/parser/generic/genericSemanticContextCollector.d.ts +9 -0
  55. package/dist/parser/generic/genericSemanticContextCollector.js +14 -0
  56. package/dist/parser/generic/genericSplitListener.d.ts +6 -0
  57. package/dist/parser/generic/genericSplitListener.js +6 -0
  58. package/dist/parser/generic/index.d.ts +33 -0
  59. package/dist/parser/generic/index.js +94 -0
  60. package/dist/parser/index.d.ts +1 -0
  61. package/dist/parser/index.js +1 -0
  62. package/dist/parser/mysql/index.js +3 -1
  63. package/dist/parser/mysql/mysqlEntityCollector.d.ts +2 -1
  64. package/dist/parser/mysql/mysqlEntityCollector.js +13 -3
  65. package/dist/parser/mysql/mysqlErrorListener.js +2 -0
  66. package/dist/parser/postgresql/postgreEntityCollector.d.ts +3 -1
  67. package/dist/parser/postgresql/postgreEntityCollector.js +13 -0
  68. package/dist/parser/spark/index.js +3 -1
  69. package/package.json +1 -1
package/README.md CHANGED
@@ -26,6 +26,7 @@ Additionally, it provides advanced features such as **SQL Validation**, **Code C
26
26
  - PostgreSQL
27
27
  - Trino
28
28
  - Impala
29
+ - GenericSQL
29
30
 
30
31
  >[!TIP]
31
32
  >This project is the default for Typescript target, also you can try to compile it to other languages if you need.
@@ -53,7 +54,7 @@ yarn add dt-sql-parser
53
54
  ## Usage
54
55
  We recommend learning the fundamentals usage before continuing. The dt-sql-parser library provides SQL classes for different types of SQL.
55
56
  ```javascript
56
- import { MySQL, FlinkSQL, SparkSQL, HiveSQL, PostgreSQL, TrinoSQL, ImpalaSQL } from 'dt-sql-parser';
57
+ import { MySQL, FlinkSQL, SparkSQL, HiveSQL, PostgreSQL, TrinoSQL, ImpalaSQL, GenericSQL } from 'dt-sql-parser';
57
58
  ```
58
59
 
59
60
  Before using syntax validation, code completion, and other features, it is necessary to instantiate the Parser of the relevant SQL type.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- export { MySQL, FlinkSQL, SparkSQL, HiveSQL, PostgreSQL, TrinoSQL, ImpalaSQL } from './parser';
2
- export { MySqlParserListener, MySqlParserVisitor, FlinkSqlParserListener, FlinkSqlParserVisitor, SparkSqlParserListener, SparkSqlParserVisitor, HiveSqlParserListener, HiveSqlParserVisitor, PostgreSqlParserListener, PostgreSqlParserVisitor, TrinoSqlListener, TrinoSqlVisitor, ImpalaSqlParserListener, ImpalaSqlParserVisitor, } from './lib';
1
+ export { MySQL, FlinkSQL, SparkSQL, HiveSQL, PostgreSQL, TrinoSQL, ImpalaSQL, GenericSQL, } from './parser';
2
+ export { MySqlParserListener, MySqlParserVisitor, FlinkSqlParserListener, FlinkSqlParserVisitor, SparkSqlParserListener, SparkSqlParserVisitor, HiveSqlParserListener, HiveSqlParserVisitor, PostgreSqlParserListener, PostgreSqlParserVisitor, TrinoSqlListener, TrinoSqlVisitor, ImpalaSqlParserListener, ImpalaSqlParserVisitor, GenericSqlListener, GenericSqlVisitor, } from './lib';
3
3
  export { EntityContextType } from './parser/common/types';
4
4
  export { StmtContextType } from './parser/common/entityCollector';
5
5
  export type { CaretPosition, Suggestions, SyntaxSuggestion } from './parser/common/types';
6
6
  export type { WordRange, TextSlice } from './parser/common/textAndWord';
7
7
  export type { SyntaxError, ParseError, ErrorListener } from './parser/common/parseErrorListener';
8
+ export type { GenericSQLOptions } from './parser/generic';
8
9
  export type { StmtContext, EntityContext, CommonEntityContext, ColumnEntityContext, FuncEntityContext, } from './parser/common/entityCollector';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { MySQL, FlinkSQL, SparkSQL, HiveSQL, PostgreSQL, TrinoSQL, ImpalaSQL } from './parser';
2
- export { MySqlParserListener, MySqlParserVisitor, FlinkSqlParserListener, FlinkSqlParserVisitor, SparkSqlParserListener, SparkSqlParserVisitor, HiveSqlParserListener, HiveSqlParserVisitor, PostgreSqlParserListener, PostgreSqlParserVisitor, TrinoSqlListener, TrinoSqlVisitor, ImpalaSqlParserListener, ImpalaSqlParserVisitor, } from './lib';
1
+ export { MySQL, FlinkSQL, SparkSQL, HiveSQL, PostgreSQL, TrinoSQL, ImpalaSQL, GenericSQL, } from './parser';
2
+ export { MySqlParserListener, MySqlParserVisitor, FlinkSqlParserListener, FlinkSqlParserVisitor, SparkSqlParserListener, SparkSqlParserVisitor, HiveSqlParserListener, HiveSqlParserVisitor, PostgreSqlParserListener, PostgreSqlParserVisitor, TrinoSqlListener, TrinoSqlVisitor, ImpalaSqlParserListener, ImpalaSqlParserVisitor, GenericSqlListener, GenericSqlVisitor, } from './lib';
3
3
  export { EntityContextType } from './parser/common/types';
4
4
  export { StmtContextType } from './parser/common/entityCollector';
@@ -4,5 +4,17 @@ export declare abstract class SQLParserBase<T = antlr.ParserRuleContext> extends
4
4
  abstract program(): T;
5
5
  caretTokenIndex: number;
6
6
  entityCollecting: boolean;
7
- shouldMatchEmpty(): boolean;
7
+ /**
8
+ * Semantic predicate to determine whether to match empty column.
9
+ *
10
+ * Key design:
11
+ * 1. Only match empty column in entityCollecting mode
12
+ * 2. Check if caret position is at the empty column position
13
+ * 3. In validate mode (entityCollecting=false), this predicate returns false
14
+ * and reports an error to ensure incomplete SQL is caught
15
+ *
16
+ * IMPORTANT: This predicate should be used carefully to avoid affecting
17
+ * prediction in non-entity-collecting contexts.
18
+ */
19
+ shouldMatchEmpty(ruleName?: string): boolean;
8
20
  }
@@ -5,10 +5,45 @@ export class SQLParserBase extends antlr.Parser {
5
5
  this.caretTokenIndex = -1;
6
6
  this.entityCollecting = false;
7
7
  }
8
- shouldMatchEmpty() {
9
- var _a, _b, _c, _d;
10
- return this.entityCollecting
11
- && ((_b = (_a = this.tokenStream.LT(-1)) === null || _a === void 0 ? void 0 : _a.tokenIndex) !== null && _b !== void 0 ? _b : Infinity) <= this.caretTokenIndex
12
- && ((_d = (_c = this.tokenStream.LT(1)) === null || _c === void 0 ? void 0 : _c.tokenIndex) !== null && _d !== void 0 ? _d : -Infinity) >= this.caretTokenIndex;
8
+ /**
9
+ * Semantic predicate to determine whether to match empty column.
10
+ *
11
+ * Key design:
12
+ * 1. Only match empty column in entityCollecting mode
13
+ * 2. Check if caret position is at the empty column position
14
+ * 3. In validate mode (entityCollecting=false), this predicate returns false
15
+ * and reports an error to ensure incomplete SQL is caught
16
+ *
17
+ * IMPORTANT: This predicate should be used carefully to avoid affecting
18
+ * prediction in non-entity-collecting contexts.
19
+ */
20
+ shouldMatchEmpty(ruleName) {
21
+ var _a, _b;
22
+ // Only match in entityCollecting mode or when caret position is specified (suggestion mode)
23
+ if (this.entityCollecting || this.caretTokenIndex >= 0) {
24
+ // If no caret position specified, match all empty columns
25
+ if (this.caretTokenIndex < 0) {
26
+ return true;
27
+ }
28
+ // Check if caret is at the position where empty column would be
29
+ const prevTokenIndex = (_a = this.tokenStream.LT(-1)) === null || _a === void 0 ? void 0 : _a.tokenIndex;
30
+ const nextTokenIndex = (_b = this.tokenStream.LT(1)) === null || _b === void 0 ? void 0 : _b.tokenIndex;
31
+ // Match if caret is between previous and next token
32
+ if (prevTokenIndex !== undefined && nextTokenIndex !== undefined) {
33
+ return prevTokenIndex <= this.caretTokenIndex && nextTokenIndex >= this.caretTokenIndex;
34
+ }
35
+ // If only previous token exists, match if caret is after it
36
+ if (prevTokenIndex !== undefined) {
37
+ return prevTokenIndex <= this.caretTokenIndex;
38
+ }
39
+ // If only next token exists, match if caret is before it
40
+ if (nextTokenIndex !== undefined) {
41
+ return nextTokenIndex >= this.caretTokenIndex;
42
+ }
43
+ return false;
44
+ }
45
+ // In pure validate mode, don't match empty columns
46
+ // This allows ANTLR to report errors naturally
47
+ return false;
13
48
  }
14
49
  }
@@ -574,190 +574,193 @@ export declare class FlinkSqlParser extends SQLParserBase {
574
574
  static readonly RULE_columnOptionDefinition = 23;
575
575
  static readonly RULE_physicalColumnDefinition = 24;
576
576
  static readonly RULE_columnNameCreate = 25;
577
- static readonly RULE_columnName = 26;
578
- static readonly RULE_columnNamePath = 27;
579
- static readonly RULE_columnNameList = 28;
580
- static readonly RULE_columnType = 29;
581
- static readonly RULE_lengthOneDimension = 30;
582
- static readonly RULE_lengthTwoOptionalDimension = 31;
583
- static readonly RULE_lengthTwoStringDimension = 32;
584
- static readonly RULE_lengthOneTypeDimension = 33;
585
- static readonly RULE_mapTypeDimension = 34;
586
- static readonly RULE_rowTypeDimension = 35;
587
- static readonly RULE_columnConstraint = 36;
588
- static readonly RULE_metadataColumnDefinition = 37;
589
- static readonly RULE_metadataKey = 38;
590
- static readonly RULE_computedColumnDefinition = 39;
591
- static readonly RULE_computedColumnExpression = 40;
592
- static readonly RULE_watermarkDefinition = 41;
593
- static readonly RULE_tableConstraint = 42;
594
- static readonly RULE_constraintName = 43;
595
- static readonly RULE_selfDefinitionClause = 44;
596
- static readonly RULE_partitionDefinition = 45;
597
- static readonly RULE_transformList = 46;
598
- static readonly RULE_transform = 47;
599
- static readonly RULE_transformArgument = 48;
600
- static readonly RULE_likeDefinition = 49;
601
- static readonly RULE_likeOption = 50;
602
- static readonly RULE_createCatalog = 51;
603
- static readonly RULE_createDatabase = 52;
604
- static readonly RULE_createView = 53;
605
- static readonly RULE_createFunction = 54;
606
- static readonly RULE_usingClause = 55;
607
- static readonly RULE_jarFileName = 56;
608
- static readonly RULE_alterTable = 57;
609
- static readonly RULE_renameDefinition = 58;
610
- static readonly RULE_setKeyValueDefinition = 59;
611
- static readonly RULE_addConstraint = 60;
612
- static readonly RULE_dropConstraint = 61;
613
- static readonly RULE_addUnique = 62;
614
- static readonly RULE_notForced = 63;
615
- static readonly RULE_alterView = 64;
616
- static readonly RULE_alterDatabase = 65;
617
- static readonly RULE_alterFunction = 66;
618
- static readonly RULE_dropCatalog = 67;
619
- static readonly RULE_dropTable = 68;
620
- static readonly RULE_dropDatabase = 69;
621
- static readonly RULE_dropView = 70;
622
- static readonly RULE_dropFunction = 71;
623
- static readonly RULE_insertStatement = 72;
624
- static readonly RULE_insertSimpleStatement = 73;
625
- static readonly RULE_insertPartitionDefinition = 74;
626
- static readonly RULE_valuesDefinition = 75;
627
- static readonly RULE_valuesRowDefinition = 76;
628
- static readonly RULE_valueDefinition = 77;
629
- static readonly RULE_insertMulStatementCompatibility = 78;
630
- static readonly RULE_insertMulStatement = 79;
631
- static readonly RULE_queryStatement = 80;
632
- static readonly RULE_valuesClause = 81;
633
- static readonly RULE_withClause = 82;
634
- static readonly RULE_withItem = 83;
635
- static readonly RULE_withItemName = 84;
636
- static readonly RULE_selectStatement = 85;
637
- static readonly RULE_selectClause = 86;
638
- static readonly RULE_selectList = 87;
639
- static readonly RULE_columnProjectItem = 88;
640
- static readonly RULE_selectWindowItemColumnName = 89;
641
- static readonly RULE_selectExpressionColumnName = 90;
642
- static readonly RULE_selectLiteralColumnName = 91;
643
- static readonly RULE_columnAlias = 92;
644
- static readonly RULE_projectItemDefinition = 93;
645
- static readonly RULE_tableAllColumns = 94;
646
- static readonly RULE_overWindowItem = 95;
647
- static readonly RULE_fromClause = 96;
648
- static readonly RULE_tableExpression = 97;
649
- static readonly RULE_tableReference = 98;
650
- static readonly RULE_tablePrimary = 99;
651
- static readonly RULE_atomFunctionTable = 100;
652
- static readonly RULE_atomExpressionTable = 101;
653
- static readonly RULE_systemTimePeriod = 102;
654
- static readonly RULE_dateTimeExpression = 103;
655
- static readonly RULE_inlineDataValueClause = 104;
656
- static readonly RULE_windowTVFClause = 105;
657
- static readonly RULE_windowTVFExpression = 106;
658
- static readonly RULE_windowTVFName = 107;
659
- static readonly RULE_windowTVFParam = 108;
660
- static readonly RULE_timeIntervalParamName = 109;
661
- static readonly RULE_columnDescriptor = 110;
662
- static readonly RULE_joinCondition = 111;
663
- static readonly RULE_whereClause = 112;
664
- static readonly RULE_groupByClause = 113;
665
- static readonly RULE_groupItemDefinition = 114;
666
- static readonly RULE_groupingSets = 115;
667
- static readonly RULE_groupingSetsNotationName = 116;
668
- static readonly RULE_groupWindowFunction = 117;
669
- static readonly RULE_groupWindowFunctionName = 118;
670
- static readonly RULE_timeAttrColumn = 119;
671
- static readonly RULE_havingClause = 120;
672
- static readonly RULE_windowClause = 121;
673
- static readonly RULE_namedWindow = 122;
674
- static readonly RULE_windowSpec = 123;
675
- static readonly RULE_matchRecognizeClause = 124;
676
- static readonly RULE_orderByClause = 125;
677
- static readonly RULE_orderItemDefinition = 126;
678
- static readonly RULE_limitClause = 127;
679
- static readonly RULE_partitionByClause = 128;
680
- static readonly RULE_quantifiers = 129;
681
- static readonly RULE_measuresClause = 130;
682
- static readonly RULE_patternDefinition = 131;
683
- static readonly RULE_patternVariable = 132;
684
- static readonly RULE_outputMode = 133;
685
- static readonly RULE_afterMatchStrategy = 134;
686
- static readonly RULE_patternVariablesDefinition = 135;
687
- static readonly RULE_windowFrame = 136;
688
- static readonly RULE_frameBound = 137;
689
- static readonly RULE_frameStart = 138;
690
- static readonly RULE_frameEnd = 139;
691
- static readonly RULE_withinClause = 140;
692
- static readonly RULE_expression = 141;
693
- static readonly RULE_booleanExpression = 142;
694
- static readonly RULE_predicate = 143;
695
- static readonly RULE_jsonFunctionBranch = 144;
696
- static readonly RULE_likePredicate = 145;
697
- static readonly RULE_valueExpression = 146;
698
- static readonly RULE_functionCallExpression = 147;
699
- static readonly RULE_primaryExpression = 148;
700
- static readonly RULE_functionNameCreate = 149;
701
- static readonly RULE_functionName = 150;
702
- static readonly RULE_functionNameAndParams = 151;
703
- static readonly RULE_functionNameWithParams = 152;
704
- static readonly RULE_functionParam = 153;
705
- static readonly RULE_jsonValueParams = 154;
706
- static readonly RULE_jsonQueryParams = 155;
707
- static readonly RULE_jsonObjectParams = 156;
708
- static readonly RULE_jsonArrayParams = 157;
709
- static readonly RULE_dereferenceDefinition = 158;
710
- static readonly RULE_correlationName = 159;
711
- static readonly RULE_qualifiedName = 160;
712
- static readonly RULE_timeIntervalExpression = 161;
713
- static readonly RULE_errorCapturingMultiUnitsInterval = 162;
714
- static readonly RULE_multiUnitsInterval = 163;
715
- static readonly RULE_errorCapturingUnitToUnitInterval = 164;
716
- static readonly RULE_unitToUnitInterval = 165;
717
- static readonly RULE_intervalValue = 166;
718
- static readonly RULE_tableAlias = 167;
719
- static readonly RULE_errorCapturingIdentifier = 168;
720
- static readonly RULE_errorCapturingIdentifierExtra = 169;
721
- static readonly RULE_identifierList = 170;
722
- static readonly RULE_identifierSeq = 171;
723
- static readonly RULE_identifier = 172;
724
- static readonly RULE_unquotedIdentifier = 173;
725
- static readonly RULE_quotedIdentifier = 174;
726
- static readonly RULE_whenClause = 175;
727
- static readonly RULE_catalogPath = 176;
728
- static readonly RULE_catalogPathCreate = 177;
729
- static readonly RULE_databasePath = 178;
730
- static readonly RULE_databasePathCreate = 179;
731
- static readonly RULE_tablePathCreate = 180;
732
- static readonly RULE_tablePath = 181;
733
- static readonly RULE_viewPath = 182;
734
- static readonly RULE_viewPathCreate = 183;
735
- static readonly RULE_uid = 184;
736
- static readonly RULE_withOption = 185;
737
- static readonly RULE_ifNotExists = 186;
738
- static readonly RULE_ifExists = 187;
739
- static readonly RULE_tablePropertyList = 188;
740
- static readonly RULE_tableProperty = 189;
741
- static readonly RULE_tablePropertyKey = 190;
742
- static readonly RULE_tablePropertyValue = 191;
743
- static readonly RULE_logicalOperator = 192;
744
- static readonly RULE_comparisonOperator = 193;
745
- static readonly RULE_bitOperator = 194;
746
- static readonly RULE_mathOperator = 195;
747
- static readonly RULE_unaryOperator = 196;
748
- static readonly RULE_constant = 197;
749
- static readonly RULE_timePointLiteral = 198;
750
- static readonly RULE_stringLiteral = 199;
751
- static readonly RULE_decimalLiteral = 200;
752
- static readonly RULE_booleanLiteral = 201;
753
- static readonly RULE_setQuantifier = 202;
754
- static readonly RULE_timePointUnit = 203;
755
- static readonly RULE_timeIntervalUnit = 204;
756
- static readonly RULE_reservedKeywordsUsedAsFuncParam = 205;
757
- static readonly RULE_reservedKeywordsNoParamsUsedAsFuncName = 206;
758
- static readonly RULE_reservedKeywordsFollowParamsUsedAsFuncName = 207;
759
- static readonly RULE_reservedKeywordsUsedAsFuncName = 208;
760
- static readonly RULE_nonReservedKeywords = 209;
577
+ static readonly RULE_emptyColumn = 26;
578
+ static readonly RULE_columnName = 27;
579
+ static readonly RULE_columnNamePath = 28;
580
+ static readonly RULE_columnNamePathAllowEmpty = 29;
581
+ static readonly RULE_columnNameList = 30;
582
+ static readonly RULE_columnType = 31;
583
+ static readonly RULE_lengthOneDimension = 32;
584
+ static readonly RULE_lengthTwoOptionalDimension = 33;
585
+ static readonly RULE_lengthTwoStringDimension = 34;
586
+ static readonly RULE_lengthOneTypeDimension = 35;
587
+ static readonly RULE_mapTypeDimension = 36;
588
+ static readonly RULE_rowTypeDimension = 37;
589
+ static readonly RULE_columnConstraint = 38;
590
+ static readonly RULE_metadataColumnDefinition = 39;
591
+ static readonly RULE_metadataKey = 40;
592
+ static readonly RULE_computedColumnDefinition = 41;
593
+ static readonly RULE_computedColumnExpression = 42;
594
+ static readonly RULE_watermarkDefinition = 43;
595
+ static readonly RULE_tableConstraint = 44;
596
+ static readonly RULE_constraintName = 45;
597
+ static readonly RULE_selfDefinitionClause = 46;
598
+ static readonly RULE_partitionDefinition = 47;
599
+ static readonly RULE_transformList = 48;
600
+ static readonly RULE_transform = 49;
601
+ static readonly RULE_transformArgument = 50;
602
+ static readonly RULE_likeDefinition = 51;
603
+ static readonly RULE_likeOption = 52;
604
+ static readonly RULE_createCatalog = 53;
605
+ static readonly RULE_createDatabase = 54;
606
+ static readonly RULE_createView = 55;
607
+ static readonly RULE_createFunction = 56;
608
+ static readonly RULE_usingClause = 57;
609
+ static readonly RULE_jarFileName = 58;
610
+ static readonly RULE_alterTable = 59;
611
+ static readonly RULE_renameDefinition = 60;
612
+ static readonly RULE_setKeyValueDefinition = 61;
613
+ static readonly RULE_addConstraint = 62;
614
+ static readonly RULE_dropConstraint = 63;
615
+ static readonly RULE_addUnique = 64;
616
+ static readonly RULE_notForced = 65;
617
+ static readonly RULE_alterView = 66;
618
+ static readonly RULE_alterDatabase = 67;
619
+ static readonly RULE_alterFunction = 68;
620
+ static readonly RULE_dropCatalog = 69;
621
+ static readonly RULE_dropTable = 70;
622
+ static readonly RULE_dropDatabase = 71;
623
+ static readonly RULE_dropView = 72;
624
+ static readonly RULE_dropFunction = 73;
625
+ static readonly RULE_insertStatement = 74;
626
+ static readonly RULE_insertSimpleStatement = 75;
627
+ static readonly RULE_insertPartitionDefinition = 76;
628
+ static readonly RULE_valuesDefinition = 77;
629
+ static readonly RULE_valuesRowDefinition = 78;
630
+ static readonly RULE_valueDefinition = 79;
631
+ static readonly RULE_insertMulStatementCompatibility = 80;
632
+ static readonly RULE_insertMulStatement = 81;
633
+ static readonly RULE_queryStatement = 82;
634
+ static readonly RULE_valuesClause = 83;
635
+ static readonly RULE_withClause = 84;
636
+ static readonly RULE_withItem = 85;
637
+ static readonly RULE_withItemName = 86;
638
+ static readonly RULE_selectStatement = 87;
639
+ static readonly RULE_selectClause = 88;
640
+ static readonly RULE_selectList = 89;
641
+ static readonly RULE_columnProjectItem = 90;
642
+ static readonly RULE_selectWindowItemColumnName = 91;
643
+ static readonly RULE_selectExpressionColumnName = 92;
644
+ static readonly RULE_selectLiteralColumnName = 93;
645
+ static readonly RULE_columnAlias = 94;
646
+ static readonly RULE_projectItemDefinition = 95;
647
+ static readonly RULE_tableAllColumns = 96;
648
+ static readonly RULE_overWindowItem = 97;
649
+ static readonly RULE_fromClause = 98;
650
+ static readonly RULE_tableExpression = 99;
651
+ static readonly RULE_tableReference = 100;
652
+ static readonly RULE_tablePrimary = 101;
653
+ static readonly RULE_atomFunctionTable = 102;
654
+ static readonly RULE_atomExpressionTable = 103;
655
+ static readonly RULE_systemTimePeriod = 104;
656
+ static readonly RULE_dateTimeExpression = 105;
657
+ static readonly RULE_inlineDataValueClause = 106;
658
+ static readonly RULE_windowTVFClause = 107;
659
+ static readonly RULE_windowTVFExpression = 108;
660
+ static readonly RULE_windowTVFName = 109;
661
+ static readonly RULE_windowTVFParam = 110;
662
+ static readonly RULE_timeIntervalParamName = 111;
663
+ static readonly RULE_columnDescriptor = 112;
664
+ static readonly RULE_joinCondition = 113;
665
+ static readonly RULE_whereClause = 114;
666
+ static readonly RULE_groupByClause = 115;
667
+ static readonly RULE_groupItemDefinition = 116;
668
+ static readonly RULE_groupingSets = 117;
669
+ static readonly RULE_groupingSetsNotationName = 118;
670
+ static readonly RULE_groupWindowFunction = 119;
671
+ static readonly RULE_groupWindowFunctionName = 120;
672
+ static readonly RULE_timeAttrColumn = 121;
673
+ static readonly RULE_havingClause = 122;
674
+ static readonly RULE_windowClause = 123;
675
+ static readonly RULE_namedWindow = 124;
676
+ static readonly RULE_windowSpec = 125;
677
+ static readonly RULE_matchRecognizeClause = 126;
678
+ static readonly RULE_orderByClause = 127;
679
+ static readonly RULE_orderItemDefinition = 128;
680
+ static readonly RULE_limitClause = 129;
681
+ static readonly RULE_partitionByClause = 130;
682
+ static readonly RULE_quantifiers = 131;
683
+ static readonly RULE_measuresClause = 132;
684
+ static readonly RULE_patternDefinition = 133;
685
+ static readonly RULE_patternVariable = 134;
686
+ static readonly RULE_outputMode = 135;
687
+ static readonly RULE_afterMatchStrategy = 136;
688
+ static readonly RULE_patternVariablesDefinition = 137;
689
+ static readonly RULE_windowFrame = 138;
690
+ static readonly RULE_frameBound = 139;
691
+ static readonly RULE_frameStart = 140;
692
+ static readonly RULE_frameEnd = 141;
693
+ static readonly RULE_withinClause = 142;
694
+ static readonly RULE_expression = 143;
695
+ static readonly RULE_booleanExpression = 144;
696
+ static readonly RULE_predicate = 145;
697
+ static readonly RULE_jsonFunctionBranch = 146;
698
+ static readonly RULE_likePredicate = 147;
699
+ static readonly RULE_valueExpression = 148;
700
+ static readonly RULE_functionCallExpression = 149;
701
+ static readonly RULE_primaryExpression = 150;
702
+ static readonly RULE_functionNameCreate = 151;
703
+ static readonly RULE_functionName = 152;
704
+ static readonly RULE_functionNameAndParams = 153;
705
+ static readonly RULE_functionNameWithParams = 154;
706
+ static readonly RULE_functionParam = 155;
707
+ static readonly RULE_jsonValueParams = 156;
708
+ static readonly RULE_jsonQueryParams = 157;
709
+ static readonly RULE_jsonObjectParams = 158;
710
+ static readonly RULE_jsonArrayParams = 159;
711
+ static readonly RULE_dereferenceDefinition = 160;
712
+ static readonly RULE_correlationName = 161;
713
+ static readonly RULE_qualifiedName = 162;
714
+ static readonly RULE_timeIntervalExpression = 163;
715
+ static readonly RULE_errorCapturingMultiUnitsInterval = 164;
716
+ static readonly RULE_multiUnitsInterval = 165;
717
+ static readonly RULE_errorCapturingUnitToUnitInterval = 166;
718
+ static readonly RULE_unitToUnitInterval = 167;
719
+ static readonly RULE_intervalValue = 168;
720
+ static readonly RULE_tableAlias = 169;
721
+ static readonly RULE_errorCapturingIdentifier = 170;
722
+ static readonly RULE_errorCapturingIdentifierExtra = 171;
723
+ static readonly RULE_identifierList = 172;
724
+ static readonly RULE_identifierSeq = 173;
725
+ static readonly RULE_identifier = 174;
726
+ static readonly RULE_unquotedIdentifier = 175;
727
+ static readonly RULE_quotedIdentifier = 176;
728
+ static readonly RULE_whenClause = 177;
729
+ static readonly RULE_catalogPath = 178;
730
+ static readonly RULE_catalogPathCreate = 179;
731
+ static readonly RULE_databasePath = 180;
732
+ static readonly RULE_databasePathCreate = 181;
733
+ static readonly RULE_tablePathCreate = 182;
734
+ static readonly RULE_tablePath = 183;
735
+ static readonly RULE_viewPath = 184;
736
+ static readonly RULE_viewPathCreate = 185;
737
+ static readonly RULE_uid = 186;
738
+ static readonly RULE_uidAllowEmpty = 187;
739
+ static readonly RULE_withOption = 188;
740
+ static readonly RULE_ifNotExists = 189;
741
+ static readonly RULE_ifExists = 190;
742
+ static readonly RULE_tablePropertyList = 191;
743
+ static readonly RULE_tableProperty = 192;
744
+ static readonly RULE_tablePropertyKey = 193;
745
+ static readonly RULE_tablePropertyValue = 194;
746
+ static readonly RULE_logicalOperator = 195;
747
+ static readonly RULE_comparisonOperator = 196;
748
+ static readonly RULE_bitOperator = 197;
749
+ static readonly RULE_mathOperator = 198;
750
+ static readonly RULE_unaryOperator = 199;
751
+ static readonly RULE_constant = 200;
752
+ static readonly RULE_timePointLiteral = 201;
753
+ static readonly RULE_stringLiteral = 202;
754
+ static readonly RULE_decimalLiteral = 203;
755
+ static readonly RULE_booleanLiteral = 204;
756
+ static readonly RULE_setQuantifier = 205;
757
+ static readonly RULE_timePointUnit = 206;
758
+ static readonly RULE_timeIntervalUnit = 207;
759
+ static readonly RULE_reservedKeywordsUsedAsFuncParam = 208;
760
+ static readonly RULE_reservedKeywordsNoParamsUsedAsFuncName = 209;
761
+ static readonly RULE_reservedKeywordsFollowParamsUsedAsFuncName = 210;
762
+ static readonly RULE_reservedKeywordsUsedAsFuncName = 211;
763
+ static readonly RULE_nonReservedKeywords = 212;
761
764
  static readonly literalNames: (string | null)[];
762
765
  static readonly symbolicNames: (string | null)[];
763
766
  static readonly ruleNames: string[];
@@ -794,8 +797,10 @@ export declare class FlinkSqlParser extends SQLParserBase {
794
797
  columnOptionDefinition(): ColumnOptionDefinitionContext;
795
798
  physicalColumnDefinition(): PhysicalColumnDefinitionContext;
796
799
  columnNameCreate(): ColumnNameCreateContext;
800
+ emptyColumn(): EmptyColumnContext;
797
801
  columnName(): ColumnNameContext;
798
802
  columnNamePath(): ColumnNamePathContext;
803
+ columnNamePathAllowEmpty(): ColumnNamePathAllowEmptyContext;
799
804
  columnNameList(): ColumnNameListContext;
800
805
  columnType(): ColumnTypeContext;
801
806
  lengthOneDimension(): LengthOneDimensionContext;
@@ -958,6 +963,7 @@ export declare class FlinkSqlParser extends SQLParserBase {
958
963
  viewPath(): ViewPathContext;
959
964
  viewPathCreate(): ViewPathCreateContext;
960
965
  uid(): UidContext;
966
+ uidAllowEmpty(): UidAllowEmptyContext;
961
967
  withOption(): WithOptionContext;
962
968
  ifNotExists(): IfNotExistsContext;
963
969
  ifExists(): IfExistsContext;
@@ -985,11 +991,14 @@ export declare class FlinkSqlParser extends SQLParserBase {
985
991
  nonReservedKeywords(): NonReservedKeywordsContext;
986
992
  sempred(localContext: antlr.RuleContext | null, ruleIndex: number, predIndex: number): boolean;
987
993
  private columnName_sempred;
994
+ private columnNamePathAllowEmpty_sempred;
988
995
  private queryStatement_sempred;
996
+ private columnProjectItem_sempred;
989
997
  private tableExpression_sempred;
990
998
  private booleanExpression_sempred;
991
999
  private valueExpression_sempred;
992
1000
  private primaryExpression_sempred;
1001
+ private uidAllowEmpty_sempred;
993
1002
  static readonly _serializedATN: number[];
994
1003
  private static __ATN;
995
1004
  static get _ATN(): antlr.ATN;
@@ -1344,9 +1353,17 @@ export declare class ColumnNameCreateContext extends antlr.ParserRuleContext {
1344
1353
  exitRule(listener: FlinkSqlParserListener): void;
1345
1354
  accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
1346
1355
  }
1356
+ export declare class EmptyColumnContext extends antlr.ParserRuleContext {
1357
+ constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
1358
+ get ruleIndex(): number;
1359
+ enterRule(listener: FlinkSqlParserListener): void;
1360
+ exitRule(listener: FlinkSqlParserListener): void;
1361
+ accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
1362
+ }
1347
1363
  export declare class ColumnNameContext extends antlr.ParserRuleContext {
1348
1364
  constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
1349
- uid(): UidContext | null;
1365
+ uidAllowEmpty(): UidAllowEmptyContext | null;
1366
+ emptyColumn(): EmptyColumnContext | null;
1350
1367
  get ruleIndex(): number;
1351
1368
  enterRule(listener: FlinkSqlParserListener): void;
1352
1369
  exitRule(listener: FlinkSqlParserListener): void;
@@ -1360,6 +1377,15 @@ export declare class ColumnNamePathContext extends antlr.ParserRuleContext {
1360
1377
  exitRule(listener: FlinkSqlParserListener): void;
1361
1378
  accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
1362
1379
  }
1380
+ export declare class ColumnNamePathAllowEmptyContext extends antlr.ParserRuleContext {
1381
+ constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
1382
+ uidAllowEmpty(): UidAllowEmptyContext | null;
1383
+ emptyColumn(): EmptyColumnContext | null;
1384
+ get ruleIndex(): number;
1385
+ enterRule(listener: FlinkSqlParserListener): void;
1386
+ exitRule(listener: FlinkSqlParserListener): void;
1387
+ accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
1388
+ }
1363
1389
  export declare class ColumnNameListContext extends antlr.ParserRuleContext {
1364
1390
  constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
1365
1391
  LR_BRACKET(): antlr.TerminalNode;
@@ -2165,6 +2191,7 @@ export declare class ColumnProjectItemContext extends antlr.ParserRuleContext {
2165
2191
  tableAllColumns(): TableAllColumnsContext | null;
2166
2192
  selectExpressionColumnName(): SelectExpressionColumnNameContext | null;
2167
2193
  columnName(): ColumnNameContext | null;
2194
+ emptyColumn(): EmptyColumnContext | null;
2168
2195
  get ruleIndex(): number;
2169
2196
  enterRule(listener: FlinkSqlParserListener): void;
2170
2197
  exitRule(listener: FlinkSqlParserListener): void;
@@ -2430,6 +2457,9 @@ export declare class JoinConditionContext extends antlr.ParserRuleContext {
2430
2457
  constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
2431
2458
  KW_ON(): antlr.TerminalNode | null;
2432
2459
  booleanExpression(): BooleanExpressionContext | null;
2460
+ columnNamePathAllowEmpty(): ColumnNamePathAllowEmptyContext[];
2461
+ columnNamePathAllowEmpty(i: number): ColumnNamePathAllowEmptyContext | null;
2462
+ EQUAL_SYMBOL(): antlr.TerminalNode | null;
2433
2463
  KW_USING(): antlr.TerminalNode | null;
2434
2464
  columnNameList(): ColumnNameListContext | null;
2435
2465
  get ruleIndex(): number;
@@ -2440,7 +2470,8 @@ export declare class JoinConditionContext extends antlr.ParserRuleContext {
2440
2470
  export declare class WhereClauseContext extends antlr.ParserRuleContext {
2441
2471
  constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
2442
2472
  KW_WHERE(): antlr.TerminalNode;
2443
- booleanExpression(): BooleanExpressionContext;
2473
+ booleanExpression(): BooleanExpressionContext | null;
2474
+ columnNamePathAllowEmpty(): ColumnNamePathAllowEmptyContext | null;
2444
2475
  get ruleIndex(): number;
2445
2476
  enterRule(listener: FlinkSqlParserListener): void;
2446
2477
  exitRule(listener: FlinkSqlParserListener): void;
@@ -3614,6 +3645,18 @@ export declare class UidContext extends antlr.ParserRuleContext {
3614
3645
  exitRule(listener: FlinkSqlParserListener): void;
3615
3646
  accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
3616
3647
  }
3648
+ export declare class UidAllowEmptyContext extends antlr.ParserRuleContext {
3649
+ constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
3650
+ identifier(): IdentifierContext[];
3651
+ identifier(i: number): IdentifierContext | null;
3652
+ DOT(): antlr.TerminalNode[];
3653
+ DOT(i: number): antlr.TerminalNode | null;
3654
+ emptyColumn(): EmptyColumnContext | null;
3655
+ get ruleIndex(): number;
3656
+ enterRule(listener: FlinkSqlParserListener): void;
3657
+ exitRule(listener: FlinkSqlParserListener): void;
3658
+ accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
3659
+ }
3617
3660
  export declare class WithOptionContext extends antlr.ParserRuleContext {
3618
3661
  constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
3619
3662
  KW_WITH(): antlr.TerminalNode;