Skip to content

Commit fd057bf

Browse files
authored
ESQL: Fix the FIRST function name (#132503)
I made a mistake in #132469
1 parent e6103ba commit fd057bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/ExpressionBuilder.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,11 @@ public String visitFunctionName(EsqlBaseParser.FunctionNameContext ctx) {
643643
}
644644

645645
private String functionName(EsqlBaseParser.FunctionNameContext ctx) {
646-
TerminalNode first = ctx.LAST();
646+
/*
647+
* FIRST and LAST are valid function names AND tokens used in `NULLS LAST`.
648+
* So we have to have special handling for them here.
649+
*/
650+
TerminalNode first = ctx.FIRST();
647651
if (first != null) {
648652
return first.getText();
649653
}

0 commit comments

Comments
 (0)