Skip to content

Commit a945357

Browse files
committed
Move ES|QL sample command from snapshot to tech preview (#129540)
* Move ES|QL sample command from snapshot to tech preview * dev_sample -> sample * fix test * fix grammar
1 parent 04d272f commit a945357

13 files changed

+2142
-2155
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ LIMIT : 'limit' -> pushMode(EXPRESSION_MODE);
7070
MV_EXPAND : 'mv_expand' -> pushMode(MVEXPAND_MODE);
7171
RENAME : 'rename' -> pushMode(RENAME_MODE);
7272
ROW : 'row' -> pushMode(EXPRESSION_MODE);
73+
SAMPLE : 'sample' -> pushMode(EXPRESSION_MODE);
7374
SHOW : 'show' -> pushMode(SHOW_MODE);
7475
SORT : 'sort' -> pushMode(EXPRESSION_MODE);
7576
STATS : 'stats' -> pushMode(EXPRESSION_MODE);
@@ -91,7 +92,6 @@ DEV_INLINESTATS : {this.isDevVersion()}? 'inlinestats' -> pushMode(EXPRESSION
9192
DEV_LOOKUP : {this.isDevVersion()}? 'lookup_🐔' -> pushMode(LOOKUP_MODE);
9293
DEV_METRICS : {this.isDevVersion()}? 'metrics' -> pushMode(METRICS_MODE);
9394
DEV_RERANK : {this.isDevVersion()}? 'rerank' -> pushMode(EXPRESSION_MODE);
94-
DEV_SAMPLE : {this.isDevVersion()}? 'sample' -> pushMode(EXPRESSION_MODE);
9595

9696
// list of all JOIN commands
9797
DEV_JOIN_FULL : {this.isDevVersion()}? 'full' -> pushMode(JOIN_MODE);

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

Lines changed: 18 additions & 17 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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ processingCommand
5454
| joinCommand
5555
| changePointCommand
5656
| completionCommand
57+
| sampleCommand
5758
// in development
5859
| {this.isDevVersion()}? inlinestatsCommand
5960
| {this.isDevVersion()}? lookupCommand
6061
| {this.isDevVersion()}? rerankCommand
61-
| {this.isDevVersion()}? sampleCommand
6262
;
6363

6464
whereCommand
@@ -356,6 +356,10 @@ changePointCommand
356356
: CHANGE_POINT value=qualifiedName (ON key=qualifiedName)? (AS targetType=qualifiedName COMMA targetPvalue=qualifiedName)?
357357
;
358358

359+
sampleCommand
360+
: SAMPLE probability=constant
361+
;
362+
359363
//
360364
// In development
361365
//
@@ -390,7 +394,3 @@ rerankCommand
390394
completionCommand
391395
: COMPLETION (targetField=qualifiedName ASSIGN)? prompt=primaryExpression WITH inferenceId=identifierOrParameter
392396
;
393-
394-
sampleCommand
395-
: DEV_SAMPLE probability=constant
396-
;

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

Lines changed: 18 additions & 17 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/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -961,16 +961,15 @@ public enum Cap {
961961
* Support for LIKE operator with a list of patterns
962962
*/
963963
LIKE_WITH_LIST_OF_PATTERNS,
964-
965964
/**
966965
* Support for the SAMPLE command
967966
*/
968-
SAMPLE_V3(Build.current().isSnapshot()),
967+
SAMPLE_V3,
969968

970969
/**
971970
* Support parameters for SAMPLE command.
972971
*/
973-
PARAMETER_FOR_SAMPLE(Build.current().isSnapshot());
972+
PARAMETER_FOR_SAMPLE;
974973

975974
private final boolean enabled;
976975

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

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

0 commit comments

Comments
 (0)