dt-sql-parser 4.1.0 → 4.1.1-beta.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/dist/lib/flink/FlinkSqlParser.d.ts +129 -87
- package/dist/lib/flink/FlinkSqlParser.js +2560 -2122
- package/dist/lib/flink/FlinkSqlParserListener.d.ts +55 -13
- package/dist/lib/flink/FlinkSqlParserVisitor.d.ts +35 -8
- package/dist/parser/flink/index.js +7 -1
- package/package.json +1 -1
- package/CHANGELOG.md +0 -369
|
@@ -678,60 +678,65 @@ export declare class FlinkSqlParser extends SQLParserBase {
|
|
|
678
678
|
static readonly RULE_predicate = 130;
|
|
679
679
|
static readonly RULE_likePredicate = 131;
|
|
680
680
|
static readonly RULE_valueExpression = 132;
|
|
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
|
|
681
|
+
static readonly RULE_functionCallExpression = 133;
|
|
682
|
+
static readonly RULE_primaryExpression = 134;
|
|
683
|
+
static readonly RULE_functionNameCreate = 135;
|
|
684
|
+
static readonly RULE_functionName = 136;
|
|
685
|
+
static readonly RULE_functionNameAndParams = 137;
|
|
686
|
+
static readonly RULE_functionNameWithParams = 138;
|
|
687
|
+
static readonly RULE_functionParam = 139;
|
|
688
|
+
static readonly RULE_dereferenceDefinition = 140;
|
|
689
|
+
static readonly RULE_correlationName = 141;
|
|
690
|
+
static readonly RULE_qualifiedName = 142;
|
|
691
|
+
static readonly RULE_timeIntervalExpression = 143;
|
|
692
|
+
static readonly RULE_errorCapturingMultiUnitsInterval = 144;
|
|
693
|
+
static readonly RULE_multiUnitsInterval = 145;
|
|
694
|
+
static readonly RULE_errorCapturingUnitToUnitInterval = 146;
|
|
695
|
+
static readonly RULE_unitToUnitInterval = 147;
|
|
696
|
+
static readonly RULE_intervalValue = 148;
|
|
697
|
+
static readonly RULE_tableAlias = 149;
|
|
698
|
+
static readonly RULE_errorCapturingIdentifier = 150;
|
|
699
|
+
static readonly RULE_errorCapturingIdentifierExtra = 151;
|
|
700
|
+
static readonly RULE_identifierList = 152;
|
|
701
|
+
static readonly RULE_identifierSeq = 153;
|
|
702
|
+
static readonly RULE_identifier = 154;
|
|
703
|
+
static readonly RULE_unquotedIdentifier = 155;
|
|
704
|
+
static readonly RULE_quotedIdentifier = 156;
|
|
705
|
+
static readonly RULE_whenClause = 157;
|
|
706
|
+
static readonly RULE_catalogPath = 158;
|
|
707
|
+
static readonly RULE_catalogPathCreate = 159;
|
|
708
|
+
static readonly RULE_databasePath = 160;
|
|
709
|
+
static readonly RULE_databasePathCreate = 161;
|
|
710
|
+
static readonly RULE_tablePathCreate = 162;
|
|
711
|
+
static readonly RULE_tablePath = 163;
|
|
712
|
+
static readonly RULE_viewPath = 164;
|
|
713
|
+
static readonly RULE_viewPathCreate = 165;
|
|
714
|
+
static readonly RULE_uid = 166;
|
|
715
|
+
static readonly RULE_withOption = 167;
|
|
716
|
+
static readonly RULE_ifNotExists = 168;
|
|
717
|
+
static readonly RULE_ifExists = 169;
|
|
718
|
+
static readonly RULE_tablePropertyList = 170;
|
|
719
|
+
static readonly RULE_tableProperty = 171;
|
|
720
|
+
static readonly RULE_tablePropertyKey = 172;
|
|
721
|
+
static readonly RULE_tablePropertyValue = 173;
|
|
722
|
+
static readonly RULE_logicalOperator = 174;
|
|
723
|
+
static readonly RULE_comparisonOperator = 175;
|
|
724
|
+
static readonly RULE_bitOperator = 176;
|
|
725
|
+
static readonly RULE_mathOperator = 177;
|
|
726
|
+
static readonly RULE_unaryOperator = 178;
|
|
727
|
+
static readonly RULE_constant = 179;
|
|
728
|
+
static readonly RULE_timePointLiteral = 180;
|
|
729
|
+
static readonly RULE_stringLiteral = 181;
|
|
730
|
+
static readonly RULE_decimalLiteral = 182;
|
|
731
|
+
static readonly RULE_booleanLiteral = 183;
|
|
732
|
+
static readonly RULE_setQuantifier = 184;
|
|
733
|
+
static readonly RULE_timePointUnit = 185;
|
|
734
|
+
static readonly RULE_timeIntervalUnit = 186;
|
|
735
|
+
static readonly RULE_reservedKeywordsUsedAsFuncParam = 187;
|
|
736
|
+
static readonly RULE_reservedKeywordsNoParamsUsedAsFuncName = 188;
|
|
737
|
+
static readonly RULE_reservedKeywordsFollowParamsUsedAsFuncName = 189;
|
|
738
|
+
static readonly RULE_reservedKeywordsUsedAsFuncName = 190;
|
|
739
|
+
static readonly RULE_nonReservedKeywords = 191;
|
|
735
740
|
static readonly literalNames: (string | null)[];
|
|
736
741
|
static readonly symbolicNames: (string | null)[];
|
|
737
742
|
static readonly ruleNames: string[];
|
|
@@ -879,10 +884,13 @@ export declare class FlinkSqlParser extends SQLParserBase {
|
|
|
879
884
|
likePredicate(): LikePredicateContext;
|
|
880
885
|
valueExpression(): ValueExpressionContext;
|
|
881
886
|
valueExpression(_p: number): ValueExpressionContext;
|
|
887
|
+
functionCallExpression(): FunctionCallExpressionContext;
|
|
882
888
|
primaryExpression(): PrimaryExpressionContext;
|
|
883
889
|
primaryExpression(_p: number): PrimaryExpressionContext;
|
|
884
890
|
functionNameCreate(): FunctionNameCreateContext;
|
|
885
891
|
functionName(): FunctionNameContext;
|
|
892
|
+
functionNameAndParams(): FunctionNameAndParamsContext;
|
|
893
|
+
functionNameWithParams(): FunctionNameWithParamsContext;
|
|
886
894
|
functionParam(): FunctionParamContext;
|
|
887
895
|
dereferenceDefinition(): DereferenceDefinitionContext;
|
|
888
896
|
correlationName(): CorrelationNameContext;
|
|
@@ -932,6 +940,8 @@ export declare class FlinkSqlParser extends SQLParserBase {
|
|
|
932
940
|
timePointUnit(): TimePointUnitContext;
|
|
933
941
|
timeIntervalUnit(): TimeIntervalUnitContext;
|
|
934
942
|
reservedKeywordsUsedAsFuncParam(): ReservedKeywordsUsedAsFuncParamContext;
|
|
943
|
+
reservedKeywordsNoParamsUsedAsFuncName(): ReservedKeywordsNoParamsUsedAsFuncNameContext;
|
|
944
|
+
reservedKeywordsFollowParamsUsedAsFuncName(): ReservedKeywordsFollowParamsUsedAsFuncNameContext;
|
|
935
945
|
reservedKeywordsUsedAsFuncName(): ReservedKeywordsUsedAsFuncNameContext;
|
|
936
946
|
nonReservedKeywords(): NonReservedKeywordsContext;
|
|
937
947
|
sempred(localContext: antlr.RuleContext | null, ruleIndex: number, predIndex: number): boolean;
|
|
@@ -2085,8 +2095,8 @@ export declare class SelectClauseContext extends antlr.ParserRuleContext {
|
|
|
2085
2095
|
export declare class ProjectItemDefinitionContext extends antlr.ParserRuleContext {
|
|
2086
2096
|
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
2087
2097
|
overWindowItem(): OverWindowItemContext | null;
|
|
2088
|
-
columnName(): ColumnNameContext | null;
|
|
2089
2098
|
expression(): ExpressionContext | null;
|
|
2099
|
+
columnName(): ColumnNameContext | null;
|
|
2090
2100
|
KW_AS(): antlr.TerminalNode | null;
|
|
2091
2101
|
get ruleIndex(): number;
|
|
2092
2102
|
enterRule(listener: FlinkSqlParserListener): void;
|
|
@@ -2155,15 +2165,9 @@ export declare class TablePrimaryContext extends antlr.ParserRuleContext {
|
|
|
2155
2165
|
systemTimePeriod(): SystemTimePeriodContext | null;
|
|
2156
2166
|
viewPath(): ViewPathContext | null;
|
|
2157
2167
|
KW_LATERAL(): antlr.TerminalNode | null;
|
|
2158
|
-
LR_BRACKET(): antlr.TerminalNode
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
functionParam(): FunctionParamContext[];
|
|
2162
|
-
functionParam(i: number): FunctionParamContext | null;
|
|
2163
|
-
RR_BRACKET(): antlr.TerminalNode[];
|
|
2164
|
-
RR_BRACKET(i: number): antlr.TerminalNode | null;
|
|
2165
|
-
COMMA(): antlr.TerminalNode[];
|
|
2166
|
-
COMMA(i: number): antlr.TerminalNode | null;
|
|
2168
|
+
LR_BRACKET(): antlr.TerminalNode | null;
|
|
2169
|
+
functionCallExpression(): FunctionCallExpressionContext | null;
|
|
2170
|
+
RR_BRACKET(): antlr.TerminalNode | null;
|
|
2167
2171
|
queryStatement(): QueryStatementContext | null;
|
|
2168
2172
|
KW_UNNEST(): antlr.TerminalNode | null;
|
|
2169
2173
|
expression(): ExpressionContext | null;
|
|
@@ -2806,6 +2810,23 @@ export declare class ArithmeticUnaryContext extends ValueExpressionContext {
|
|
|
2806
2810
|
exitRule(listener: FlinkSqlParserListener): void;
|
|
2807
2811
|
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
2808
2812
|
}
|
|
2813
|
+
export declare class FunctionCallExpressionContext extends antlr.ParserRuleContext {
|
|
2814
|
+
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
2815
|
+
reservedKeywordsNoParamsUsedAsFuncName(): ReservedKeywordsNoParamsUsedAsFuncNameContext | null;
|
|
2816
|
+
functionNameAndParams(): FunctionNameAndParamsContext | null;
|
|
2817
|
+
functionNameWithParams(): FunctionNameWithParamsContext | null;
|
|
2818
|
+
LR_BRACKET(): antlr.TerminalNode | null;
|
|
2819
|
+
RR_BRACKET(): antlr.TerminalNode | null;
|
|
2820
|
+
functionParam(): FunctionParamContext[];
|
|
2821
|
+
functionParam(i: number): FunctionParamContext | null;
|
|
2822
|
+
setQuantifier(): SetQuantifierContext | null;
|
|
2823
|
+
COMMA(): antlr.TerminalNode[];
|
|
2824
|
+
COMMA(i: number): antlr.TerminalNode | null;
|
|
2825
|
+
get ruleIndex(): number;
|
|
2826
|
+
enterRule(listener: FlinkSqlParserListener): void;
|
|
2827
|
+
exitRule(listener: FlinkSqlParserListener): void;
|
|
2828
|
+
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
2829
|
+
}
|
|
2809
2830
|
export declare class PrimaryExpressionContext extends antlr.ParserRuleContext {
|
|
2810
2831
|
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
2811
2832
|
get ruleIndex(): number;
|
|
@@ -2912,14 +2933,7 @@ export declare class ParenthesizedExpressionContext extends PrimaryExpressionCon
|
|
|
2912
2933
|
}
|
|
2913
2934
|
export declare class FunctionCallContext extends PrimaryExpressionContext {
|
|
2914
2935
|
constructor(ctx: PrimaryExpressionContext);
|
|
2915
|
-
|
|
2916
|
-
LR_BRACKET(): antlr.TerminalNode;
|
|
2917
|
-
RR_BRACKET(): antlr.TerminalNode;
|
|
2918
|
-
functionParam(): FunctionParamContext[];
|
|
2919
|
-
functionParam(i: number): FunctionParamContext | null;
|
|
2920
|
-
setQuantifier(): SetQuantifierContext | null;
|
|
2921
|
-
COMMA(): antlr.TerminalNode[];
|
|
2922
|
-
COMMA(i: number): antlr.TerminalNode | null;
|
|
2936
|
+
functionCallExpression(): FunctionCallExpressionContext;
|
|
2923
2937
|
enterRule(listener: FlinkSqlParserListener): void;
|
|
2924
2938
|
exitRule(listener: FlinkSqlParserListener): void;
|
|
2925
2939
|
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
@@ -2951,13 +2965,6 @@ export declare class PositionContext extends PrimaryExpressionContext {
|
|
|
2951
2965
|
exitRule(listener: FlinkSqlParserListener): void;
|
|
2952
2966
|
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
2953
2967
|
}
|
|
2954
|
-
export declare class DateFunctionExpressionContext extends PrimaryExpressionContext {
|
|
2955
|
-
constructor(ctx: PrimaryExpressionContext);
|
|
2956
|
-
KW_CURRENT_TIMESTAMP(): antlr.TerminalNode;
|
|
2957
|
-
enterRule(listener: FlinkSqlParserListener): void;
|
|
2958
|
-
exitRule(listener: FlinkSqlParserListener): void;
|
|
2959
|
-
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
2960
|
-
}
|
|
2961
2968
|
export declare class FirstContext extends PrimaryExpressionContext {
|
|
2962
2969
|
constructor(ctx: PrimaryExpressionContext);
|
|
2963
2970
|
KW_FIRST(): antlr.TerminalNode;
|
|
@@ -2979,6 +2986,27 @@ export declare class FunctionNameCreateContext extends antlr.ParserRuleContext {
|
|
|
2979
2986
|
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
2980
2987
|
}
|
|
2981
2988
|
export declare class FunctionNameContext extends antlr.ParserRuleContext {
|
|
2989
|
+
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
2990
|
+
reservedKeywordsUsedAsFuncName(): ReservedKeywordsUsedAsFuncNameContext | null;
|
|
2991
|
+
reservedKeywordsNoParamsUsedAsFuncName(): ReservedKeywordsNoParamsUsedAsFuncNameContext | null;
|
|
2992
|
+
reservedKeywordsFollowParamsUsedAsFuncName(): ReservedKeywordsFollowParamsUsedAsFuncNameContext | null;
|
|
2993
|
+
uid(): UidContext | null;
|
|
2994
|
+
get ruleIndex(): number;
|
|
2995
|
+
enterRule(listener: FlinkSqlParserListener): void;
|
|
2996
|
+
exitRule(listener: FlinkSqlParserListener): void;
|
|
2997
|
+
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
2998
|
+
}
|
|
2999
|
+
export declare class FunctionNameAndParamsContext extends antlr.ParserRuleContext {
|
|
3000
|
+
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
3001
|
+
reservedKeywordsFollowParamsUsedAsFuncName(): ReservedKeywordsFollowParamsUsedAsFuncNameContext | null;
|
|
3002
|
+
STRING_LITERAL(): antlr.TerminalNode | null;
|
|
3003
|
+
timeIntervalExpression(): TimeIntervalExpressionContext | null;
|
|
3004
|
+
get ruleIndex(): number;
|
|
3005
|
+
enterRule(listener: FlinkSqlParserListener): void;
|
|
3006
|
+
exitRule(listener: FlinkSqlParserListener): void;
|
|
3007
|
+
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
3008
|
+
}
|
|
3009
|
+
export declare class FunctionNameWithParamsContext extends antlr.ParserRuleContext {
|
|
2982
3010
|
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
2983
3011
|
reservedKeywordsUsedAsFuncName(): ReservedKeywordsUsedAsFuncNameContext | null;
|
|
2984
3012
|
uid(): UidContext | null;
|
|
@@ -3565,6 +3593,28 @@ export declare class ReservedKeywordsUsedAsFuncParamContext extends antlr.Parser
|
|
|
3565
3593
|
exitRule(listener: FlinkSqlParserListener): void;
|
|
3566
3594
|
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
3567
3595
|
}
|
|
3596
|
+
export declare class ReservedKeywordsNoParamsUsedAsFuncNameContext extends antlr.ParserRuleContext {
|
|
3597
|
+
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
3598
|
+
KW_LOCALTIME(): antlr.TerminalNode | null;
|
|
3599
|
+
KW_LOCALTIMESTAMP(): antlr.TerminalNode | null;
|
|
3600
|
+
KW_CURRENT_TIME(): antlr.TerminalNode | null;
|
|
3601
|
+
KW_CURRENT_DATE(): antlr.TerminalNode | null;
|
|
3602
|
+
KW_CURRENT_TIMESTAMP(): antlr.TerminalNode | null;
|
|
3603
|
+
get ruleIndex(): number;
|
|
3604
|
+
enterRule(listener: FlinkSqlParserListener): void;
|
|
3605
|
+
exitRule(listener: FlinkSqlParserListener): void;
|
|
3606
|
+
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
3607
|
+
}
|
|
3608
|
+
export declare class ReservedKeywordsFollowParamsUsedAsFuncNameContext extends antlr.ParserRuleContext {
|
|
3609
|
+
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
3610
|
+
KW_DATE(): antlr.TerminalNode | null;
|
|
3611
|
+
KW_TIME(): antlr.TerminalNode | null;
|
|
3612
|
+
KW_TIMESTAMP(): antlr.TerminalNode | null;
|
|
3613
|
+
get ruleIndex(): number;
|
|
3614
|
+
enterRule(listener: FlinkSqlParserListener): void;
|
|
3615
|
+
exitRule(listener: FlinkSqlParserListener): void;
|
|
3616
|
+
accept<Result>(visitor: FlinkSqlParserVisitor<Result>): Result | null;
|
|
3617
|
+
}
|
|
3568
3618
|
export declare class ReservedKeywordsUsedAsFuncNameContext extends antlr.ParserRuleContext {
|
|
3569
3619
|
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
3570
3620
|
KW_ABS(): antlr.TerminalNode | null;
|
|
@@ -3578,10 +3628,6 @@ export declare class ReservedKeywordsUsedAsFuncNameContext extends antlr.ParserR
|
|
|
3578
3628
|
KW_COLLECT(): antlr.TerminalNode | null;
|
|
3579
3629
|
KW_COUNT(): antlr.TerminalNode | null;
|
|
3580
3630
|
KW_CUME_DIST(): antlr.TerminalNode | null;
|
|
3581
|
-
KW_CURRENT_DATE(): antlr.TerminalNode | null;
|
|
3582
|
-
KW_CURRENT_TIME(): antlr.TerminalNode | null;
|
|
3583
|
-
KW_CURRENT_TIMESTAMP(): antlr.TerminalNode | null;
|
|
3584
|
-
KW_DATE(): antlr.TerminalNode | null;
|
|
3585
3631
|
KW_DAYOFWEEK(): antlr.TerminalNode | null;
|
|
3586
3632
|
KW_DAYOFYEAR(): antlr.TerminalNode | null;
|
|
3587
3633
|
KW_DENSE_RANK(): antlr.TerminalNode | null;
|
|
@@ -3598,8 +3644,6 @@ export declare class ReservedKeywordsUsedAsFuncNameContext extends antlr.ParserR
|
|
|
3598
3644
|
KW_LEAD(): antlr.TerminalNode | null;
|
|
3599
3645
|
KW_LEFT(): antlr.TerminalNode | null;
|
|
3600
3646
|
KW_LN(): antlr.TerminalNode | null;
|
|
3601
|
-
KW_LOCALTIME(): antlr.TerminalNode | null;
|
|
3602
|
-
KW_LOCALTIMESTAMP(): antlr.TerminalNode | null;
|
|
3603
3647
|
KW_LOWER(): antlr.TerminalNode | null;
|
|
3604
3648
|
KW_MAP(): antlr.TerminalNode | null;
|
|
3605
3649
|
KW_MAX(): antlr.TerminalNode | null;
|
|
@@ -3624,8 +3668,6 @@ export declare class ReservedKeywordsUsedAsFuncNameContext extends antlr.ParserR
|
|
|
3624
3668
|
KW_STDDEV_SAMP(): antlr.TerminalNode | null;
|
|
3625
3669
|
KW_SUBSTRING(): antlr.TerminalNode | null;
|
|
3626
3670
|
KW_SUM(): antlr.TerminalNode | null;
|
|
3627
|
-
KW_TIME(): antlr.TerminalNode | null;
|
|
3628
|
-
KW_TIMESTAMP(): antlr.TerminalNode | null;
|
|
3629
3671
|
KW_TIMESTAMP_DIFF(): antlr.TerminalNode | null;
|
|
3630
3672
|
KW_TRIM(): antlr.TerminalNode | null;
|
|
3631
3673
|
KW_TRUNCATE(): antlr.TerminalNode | null;
|