@@ -515,11 +515,7 @@ tableReference
515
515
tablePrimary
516
516
: KW_TABLE ? tablePath systemTimePeriod?
517
517
| viewPath systemTimePeriod?
518
- | KW_LATERAL KW_TABLE LR_BRACKET (
519
- (functionNameWithParams LR_BRACKET functionParam (COMMA functionParam)* RR_BRACKET )
520
- | reservedKeywordsNoParamsUsedAsFuncName
521
- | functionNameAndParams
522
- ) RR_BRACKET
518
+ | KW_LATERAL KW_TABLE LR_BRACKET functionCallExpression RR_BRACKET
523
519
| KW_LATERAL ? LR_BRACKET queryStatement RR_BRACKET
524
520
| KW_UNNEST LR_BRACKET expression RR_BRACKET
525
521
;
@@ -751,6 +747,12 @@ valueExpression
751
747
| left=valueExpression comparisonOperator right=valueExpression # comparison
752
748
;
753
749
750
+ functionCallExpression
751
+ : reservedKeywordsNoParamsUsedAsFuncName
752
+ | functionNameAndParams
753
+ | functionNameWithParams LR_BRACKET (setQuantifier? functionParam (COMMA functionParam)*)? RR_BRACKET
754
+ ;
755
+
754
756
primaryExpression
755
757
: KW_CASE whenClause+ (KW_ELSE elseExpression=expression)? KW_END # searchedCase
756
758
| KW_CASE value=expression whenClause+ (KW_ELSE elseExpression=expression)? KW_END # simpleCase
@@ -764,13 +766,7 @@ primaryExpression
764
766
| uid DOT ASTERISK_SIGN # star
765
767
// | LR_BRACKET namedExpression (COMMA namedExpression)+ RR_BRACKET #rowConstructor
766
768
| LR_BRACKET queryStatement RR_BRACKET # subqueryExpression
767
- | (
768
- reservedKeywordsNoParamsUsedAsFuncName
769
- | functionNameAndParams
770
- | (
771
- functionNameWithParams LR_BRACKET (setQuantifier? functionParam (COMMA functionParam)*)? RR_BRACKET
772
- )
773
- ) # functionCall
769
+ | functionCallExpression # functionCall
774
770
// | identifier '->' expression #lambda
775
771
// | '(' identifier (',' identifier)+ ')' '->' expression #lambda
776
772
| value=primaryExpression LS_BRACKET index=valueExpression RS_BRACKET # subscript
0 commit comments