Skip to content

Commit 202b513

Browse files
[ES|QL] Update grammars (#237568)
This PR updates the ES|QL grammars (lexer and parser) to match the latest version in Elasticsearch.
1 parent f27b78f commit 202b513

File tree

9 files changed

+1677
-1667
lines changed

9 files changed

+1677
-1667
lines changed

src/platform/packages/shared/kbn-esql-ast/src/antlr/esql_lexer.interp

Lines changed: 9 additions & 4 deletions
Large diffs are not rendered by default.

src/platform/packages/shared/kbn-esql-ast/src/antlr/esql_lexer.tokens

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WHERE=17
1818
FROM=18
1919
TS=19
2020
FORK=20
21-
DEV_FUSE=21
21+
FUSE=21
2222
INLINE=22
2323
INLINESTATS=23
2424
JOIN_LOOKUP=24
@@ -164,6 +164,7 @@ SHOW_WS=151
164164
'from'=18
165165
'ts'=19
166166
'fork'=20
167+
'fuse'=21
167168
'inline'=22
168169
'inlinestats'=23
169170
'lookup'=24

src/platform/packages/shared/kbn-esql-ast/src/antlr/esql_lexer.ts

Lines changed: 729 additions & 725 deletions
Large diffs are not rendered by default.

src/platform/packages/shared/kbn-esql-ast/src/antlr/esql_parser.g4

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ processingCommand
6868
| forkCommand
6969
| rerankCommand
7070
| inlineStatsCommand
71+
| fuseCommand
7172
// in development
7273
| {this.isDevVersion()}? lookupCommand
7374
| {this.isDevVersion()}? insistCommand
74-
| {this.isDevVersion()}? fuseCommand
7575
;
7676

7777
whereCommand
@@ -328,6 +328,17 @@ inlineStatsCommand
328328
| INLINESTATS stats=aggFields (BY grouping=fields)?
329329
;
330330

331+
fuseCommand
332+
: FUSE (fuseType=identifier)? (fuseConfiguration)*
333+
;
334+
335+
fuseConfiguration
336+
: SCORE BY score=qualifiedName
337+
| KEY BY key=fields
338+
| GROUP BY group=qualifiedName
339+
| WITH options=mapExpression
340+
;
341+
331342
//
332343
// In development
333344
//
@@ -339,17 +350,6 @@ insistCommand
339350
: DEV_INSIST qualifiedNamePatterns
340351
;
341352

342-
fuseCommand
343-
: DEV_FUSE (fuseType=identifier)? (fuseConfiguration)*
344-
;
345-
346-
fuseConfiguration
347-
: SCORE BY score=qualifiedName
348-
| KEY BY key=fields
349-
| GROUP BY group=qualifiedName
350-
| WITH options=mapExpression
351-
;
352-
353353
setCommand
354354
: SET setField SEMICOLON
355355
;

src/platform/packages/shared/kbn-esql-ast/src/antlr/esql_parser.interp

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

src/platform/packages/shared/kbn-esql-ast/src/antlr/esql_parser.tokens

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WHERE=17
1818
FROM=18
1919
TS=19
2020
FORK=20
21-
DEV_FUSE=21
21+
FUSE=21
2222
INLINE=22
2323
INLINESTATS=23
2424
JOIN_LOOKUP=24
@@ -164,6 +164,7 @@ SHOW_WS=151
164164
'from'=18
165165
'ts'=19
166166
'fork'=20
167+
'fuse'=21
167168
'inline'=22
168169
'inlinestats'=23
169170
'lookup'=24

0 commit comments

Comments
 (0)