Skip to content

[ES|QL] Enable the completion command as a tech preview feature #128948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/changelog/128948.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 128948
summary: ES|QL - Add COMPLETION command as a tech preview feature
area: ES|QL
type: feature
issues:
- 124405
35 changes: 18 additions & 17 deletions x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.tokens

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ processingCommand
| mvExpandCommand
| joinCommand
| changePointCommand
| completionCommand
// in development
| {this.isDevVersion()}? inlinestatsCommand
| {this.isDevVersion()}? lookupCommand
| {this.isDevVersion()}? completionCommand
| {this.isDevVersion()}? insistCommand
| {this.isDevVersion()}? forkCommand
| {this.isDevVersion()}? rerankCommand
Expand Down Expand Up @@ -308,7 +308,7 @@ rerankCommand
;

completionCommand
: DEV_COMPLETION prompt=primaryExpression WITH inferenceId=identifierOrParameter (AS targetField=qualifiedName)?
: COMPLETION prompt=primaryExpression WITH inferenceId=identifierOrParameter (AS targetField=qualifiedName)?
;

sampleCommand
Expand Down
35 changes: 18 additions & 17 deletions x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.tokens

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x-pack/plugin/esql/src/main/antlr/lexer/Expression.g4
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ lexer grammar Expression;
//
// Expression - used by many commands
//
COMPLETION : 'completion' -> pushMode(EXPRESSION_MODE);
DISSECT : 'dissect' -> pushMode(EXPRESSION_MODE);
EVAL : 'eval' -> pushMode(EXPRESSION_MODE);
GROK : 'grok' -> pushMode(EXPRESSION_MODE);
Expand All @@ -18,7 +19,6 @@ SORT : 'sort' -> pushMode(EXPRESSION_MODE);
STATS : 'stats' -> pushMode(EXPRESSION_MODE);
WHERE : 'where' -> pushMode(EXPRESSION_MODE);

DEV_COMPLETION : {this.isDevVersion()}? 'completion' -> pushMode(EXPRESSION_MODE);
DEV_INLINESTATS : {this.isDevVersion()}? 'inlinestats' -> pushMode(EXPRESSION_MODE);
DEV_RERANK : {this.isDevVersion()}? 'rerank' -> pushMode(EXPRESSION_MODE);
DEV_SAMPLE : {this.isDevVersion()}? 'sample' -> pushMode(EXPRESSION_MODE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ public enum Cap {
/**
* Support for COMPLETION command
*/
COMPLETION(Build.current().isSnapshot()),
COMPLETION,

/**
* Allow mixed numeric types in conditional functions - case, greatest and least
Expand Down

Large diffs are not rendered by default.

Loading
Loading