Skip to content

Commit 2b8bc19

Browse files
committed
ES|QL Completion command syntax change (elastic#129189)
1 parent 453034b commit 2b8bc19

File tree

13 files changed

+1551
-1558
lines changed

13 files changed

+1551
-1558
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/completion.csv-spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ completion using a ROW source operator
66
required_capability: completion
77

88
ROW prompt="Who is Victor Hugo?"
9-
| COMPLETION prompt WITH test_completion AS completion_output
9+
| COMPLETION completion_output = prompt WITH test_completion
1010
;
1111

1212
prompt:keyword | completion_output:keyword
@@ -18,7 +18,7 @@ completion using a ROW source operator and prompt is a multi-valued field
1818
required_capability: completion
1919

2020
ROW prompt=["Answer the following question:", "Who is Victor Hugo?"]
21-
| COMPLETION prompt WITH test_completion AS completion_output
21+
| COMPLETION completion_output = prompt WITH test_completion
2222
;
2323

2424
prompt:keyword | completion_output:keyword

x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.g4

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ DECIMAL_LITERAL
180180

181181

182182
AND : 'and';
183-
AS: 'as';
184183
ASC : 'asc';
185184
ASSIGN : '=';
186185
BY : 'by';
@@ -370,7 +369,7 @@ RENAME_NAMED_OR_POSITIONAL_PARAM : NAMED_OR_POSITIONAL_PARAM -> type(NAMED_OR_PO
370369
RENAME_DOUBLE_PARAMS : DOUBLE_PARAMS -> type(DOUBLE_PARAMS);
371370
RENAME_NAMED_OR_POSITIONAL_DOUBLE_PARAMS : NAMED_OR_POSITIONAL_DOUBLE_PARAMS -> type(NAMED_OR_POSITIONAL_DOUBLE_PARAMS);
372371
373-
RENAME_AS : AS -> type(AS);
372+
AS: 'as';
374373
375374
RENAME_ID_PATTERN
376375
: ID_PATTERN -> type(ID_PATTERN)

x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.tokens

Lines changed: 105 additions & 105 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,5 +382,5 @@ rerankCommand
382382
;
383383

384384
completionCommand
385-
: COMPLETION prompt=primaryExpression WITH inferenceId=identifierOrParameter (AS targetField=qualifiedName)?
385+
: COMPLETION (targetField=qualifiedName ASSIGN)? prompt=primaryExpression WITH inferenceId=identifierOrParameter
386386
;

0 commit comments

Comments
 (0)