Skip to content

Commit 00d1e42

Browse files
committed
ESQL: Add syntax for FIRST and LAST
``` | STATS FIRST(v BY @timestamp) BY hostname ``` Related to #108385
1 parent 70f4e7c commit 00d1e42

File tree

9 files changed

+702
-562
lines changed

9 files changed

+702
-562
lines changed

x-pack/plugin/esql/src/main/antlr/parser/Expression.g4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ primaryExpression
4949
;
5050

5151
functionExpression
52-
: functionName LP (ASTERISK | (booleanExpression (COMMA booleanExpression)* (COMMA mapExpression)?))? RP
52+
: functionName LP (ASTERISK | (booleanExpression (COMMA booleanExpression)* (COMMA mapExpression)?))? RP #functionStandard
53+
| (FIRST | LAST) LP value=booleanExpression BY by=booleanExpression RP #functionFirstLast
5354
;
5455

5556
functionName

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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)