File tree Expand file tree Collapse file tree
java/org/opensearch/sql/ppl/parser Expand file tree Collapse file tree Original file line number Diff line number Diff 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
438437primaryExpression
@@ -559,10 +558,20 @@ functionArgs
559558 ;
560559
561560functionArg
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+
566575relevanceArg
567576 : relevanceArgName EQUAL relevanceArgValue
568577 ;
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments