Skip to content

Commit 794df29

Browse files
committed
fix g4 file
Signed-off-by: xinyual <xinyual@amazon.com>
1 parent b5c4a03 commit 794df29

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

ppl/src/main/antlr/OpenSearchPPLParser.g4

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,7 @@ valueExpression
431431
| timestampFunction # timestampFunctionCall
432432
| LT_PRTHS valueExpression RT_PRTHS # parentheticValueExpr
433433
| LT_SQR_PRTHS subSearch RT_SQR_PRTHS # scalarSubqueryExpr
434-
| ident ARROW expression # lambda
435-
| LT_PRTHS ident (COMMA ident)+ RT_PRTHS ARROW expression # lambda
434+
| lambda # lambdaExpr
436435
;
437436

438437
primaryExpression
@@ -559,10 +558,20 @@ functionArgs
559558
;
560559

561560
functionArg
562-
: (ident EQUAL)? (valueExpression | comparisonExpression)
561+
: (ident EQUAL)? functionArgExpression
563562
;
564563

565564

565+
functionArgExpression
566+
: lambda
567+
| expression
568+
;
569+
570+
lambda
571+
: ident ARROW expression
572+
| LT_PRTHS ident (COMMA ident)+ RT_PRTHS ARROW expression
573+
;
574+
566575
relevanceArg
567576
: relevanceArgName EQUAL relevanceArgValue
568577
;

ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ public UnresolvedPlan visitTableFunction(TableFunctionContext ctx) {
507507
String argName = (arg.ident() != null) ? arg.ident().getText() : null;
508508
builder.add(
509509
new UnresolvedArgument(
510-
argName, this.internalVisitExpression(arg.valueExpression())));
510+
argName, this.internalVisitExpression(arg.functionArgExpression())));
511511
});
512512
return new TableFunction(this.internalVisitExpression(ctx.qualifiedName()), builder.build());
513513
}

0 commit comments

Comments
 (0)