Skip to content

Commit 2d9d0dc

Browse files
[ES|QL] Take double parameter markers for identifiers out of snapshot (elastic#125690) (elastic#125817)
* take double parameter markers out of snapshot (cherry picked from commit a0dce5c) # Conflicts: # x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.tokens # x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.tokens # x-pack/plugin/esql/src/main/antlr/lexer/Enrich.g4 # x-pack/plugin/esql/src/main/antlr/lexer/Expression.g4 # x-pack/plugin/esql/src/main/antlr/lexer/MvExpand.g4 # x-pack/plugin/esql/src/main/antlr/lexer/Project.g4 # x-pack/plugin/esql/src/main/antlr/lexer/Rename.g4 # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.interp # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.interp # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.java
1 parent 054dc1b commit 2d9d0dc

File tree

13 files changed

+1343
-1444
lines changed

13 files changed

+1343
-1444
lines changed

docs/changelog/125690.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 125690
2+
summary: Take double parameter markers for identifiers out of snapshot
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -808,10 +808,7 @@ public void testErrorMessageForMissingParams() throws IOException {
808808
}
809809

810810
public void testDoubleParamsForIdentifiers() throws IOException {
811-
assumeTrue(
812-
"double parameters markers for identifiers requires snapshot build",
813-
EsqlCapabilities.Cap.DOUBLE_PARAMETER_MARKERS_FOR_IDENTIFIERS.isEnabled()
814-
);
811+
assumeTrue("double parameters markers for identifiers", EsqlCapabilities.Cap.DOUBLE_PARAMETER_MARKERS_FOR_IDENTIFIERS.isEnabled());
815812
bulkLoadTestData(10);
816813
// positive
817814
// named double parameters
@@ -953,10 +950,7 @@ public void testDoubleParamsForIdentifiers() throws IOException {
953950
}
954951

955952
public void testDoubleParamsWithLookupJoin() throws IOException {
956-
assumeTrue(
957-
"double parameters markers for identifiers requires snapshot build",
958-
EsqlCapabilities.Cap.DOUBLE_PARAMETER_MARKERS_FOR_IDENTIFIERS.isEnabled()
959-
);
953+
assumeTrue("double parameters markers for identifiers", EsqlCapabilities.Cap.DOUBLE_PARAMETER_MARKERS_FOR_IDENTIFIERS.isEnabled());
960954
bulkLoadTestDataLookupMode(10);
961955
var query = requestObjectBuilder().query(
962956
format(

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ PERCENT : '%';
218218
LEFT_BRACES : '{';
219219
RIGHT_BRACES : '}';
220220

221-
DOUBLE_PARAMS: {this.isDevVersion()}? '??';
221+
DOUBLE_PARAMS: '??';
222222

223223
NESTED_WHERE : WHERE -> type(WHERE);
224224

@@ -323,8 +323,8 @@ PROJECT_DOT: DOT -> type(DOT);
323323
PROJECT_COMMA : COMMA -> type(COMMA);
324324
PROJECT_PARAM : PARAM -> type(PARAM);
325325
PROJECT_NAMED_OR_POSITIONAL_PARAM : NAMED_OR_POSITIONAL_PARAM -> type(NAMED_OR_POSITIONAL_PARAM);
326-
PROJECT_DOUBLE_PARAMS : {this.isDevVersion()}? DOUBLE_PARAMS -> type(DOUBLE_PARAMS);
327-
PROJECT_NAMED_OR_POSITIONAL_DOUBLE_PARAMS : {this.isDevVersion()}? NAMED_OR_POSITIONAL_DOUBLE_PARAMS -> type(NAMED_OR_POSITIONAL_DOUBLE_PARAMS);
326+
PROJECT_DOUBLE_PARAMS : DOUBLE_PARAMS -> type(DOUBLE_PARAMS);
327+
PROJECT_NAMED_OR_POSITIONAL_DOUBLE_PARAMS : NAMED_OR_POSITIONAL_DOUBLE_PARAMS -> type(NAMED_OR_POSITIONAL_DOUBLE_PARAMS);
328328
329329
fragment UNQUOTED_ID_BODY_WITH_PATTERN
330330
: (LETTER | DIGIT | UNDERSCORE | ASTERISK)
@@ -360,8 +360,8 @@ RENAME_COMMA : COMMA -> type(COMMA);
360360
RENAME_DOT: DOT -> type(DOT);
361361
RENAME_PARAM : PARAM -> type(PARAM);
362362
RENAME_NAMED_OR_POSITIONAL_PARAM : NAMED_OR_POSITIONAL_PARAM -> type(NAMED_OR_POSITIONAL_PARAM);
363-
RENAME_DOUBLE_PARAMS : {this.isDevVersion()}? DOUBLE_PARAMS -> type(DOUBLE_PARAMS);
364-
RENAME_NAMED_OR_POSITIONAL_DOUBLE_PARAMS : {this.isDevVersion()}? NAMED_OR_POSITIONAL_DOUBLE_PARAMS -> type(NAMED_OR_POSITIONAL_DOUBLE_PARAMS);
363+
RENAME_DOUBLE_PARAMS : DOUBLE_PARAMS -> type(DOUBLE_PARAMS);
364+
RENAME_NAMED_OR_POSITIONAL_DOUBLE_PARAMS : NAMED_OR_POSITIONAL_DOUBLE_PARAMS -> type(NAMED_OR_POSITIONAL_DOUBLE_PARAMS);
365365
366366
AS : 'as';
367367
@@ -435,8 +435,8 @@ ENRICH_FIELD_QUOTED_IDENTIFIER
435435

436436
ENRICH_FIELD_PARAM : PARAM -> type(PARAM);
437437
ENRICH_FIELD_NAMED_OR_POSITIONAL_PARAM : NAMED_OR_POSITIONAL_PARAM -> type(NAMED_OR_POSITIONAL_PARAM);
438-
ENRICH_FIELD_DOUBLE_PARAMS : {this.isDevVersion()}? DOUBLE_PARAMS -> type(DOUBLE_PARAMS);
439-
ENRICH_FIELD_NAMED_OR_POSITIONAL_DOUBLE_PARAMS : {this.isDevVersion()}? NAMED_OR_POSITIONAL_DOUBLE_PARAMS -> type(NAMED_OR_POSITIONAL_DOUBLE_PARAMS);
438+
ENRICH_FIELD_DOUBLE_PARAMS : DOUBLE_PARAMS -> type(DOUBLE_PARAMS);
439+
ENRICH_FIELD_NAMED_OR_POSITIONAL_DOUBLE_PARAMS : NAMED_OR_POSITIONAL_DOUBLE_PARAMS -> type(NAMED_OR_POSITIONAL_DOUBLE_PARAMS);
440440

441441
ENRICH_FIELD_LINE_COMMENT
442442
: LINE_COMMENT -> channel(HIDDEN)
@@ -455,8 +455,8 @@ MVEXPAND_PIPE : PIPE -> type(PIPE), popMode;
455455
MVEXPAND_DOT: DOT -> type(DOT);
456456
MVEXPAND_PARAM : PARAM -> type(PARAM);
457457
MVEXPAND_NAMED_OR_POSITIONAL_PARAM : NAMED_OR_POSITIONAL_PARAM -> type(NAMED_OR_POSITIONAL_PARAM);
458-
MVEXPAND_DOUBLE_PARAMS : {this.isDevVersion()}? DOUBLE_PARAMS -> type(DOUBLE_PARAMS);
459-
MVEXPAND_NAMED_OR_POSITIONAL_DOUBLE_PARAMS : {this.isDevVersion()}? NAMED_OR_POSITIONAL_DOUBLE_PARAMS -> type(NAMED_OR_POSITIONAL_DOUBLE_PARAMS);
458+
MVEXPAND_DOUBLE_PARAMS : DOUBLE_PARAMS -> type(DOUBLE_PARAMS);
459+
MVEXPAND_NAMED_OR_POSITIONAL_DOUBLE_PARAMS : NAMED_OR_POSITIONAL_DOUBLE_PARAMS -> type(NAMED_OR_POSITIONAL_DOUBLE_PARAMS);
460460

461461
MVEXPAND_QUOTED_IDENTIFIER
462462
: QUOTED_IDENTIFIER -> type(QUOTED_IDENTIFIER)

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

Lines changed: 1 addition & 0 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ identifier
204204
identifierPattern
205205
: ID_PATTERN
206206
| parameter
207-
| {this.isDevVersion()}? doubleParameter
207+
| doubleParameter
208208
;
209209

210210
constant
@@ -233,7 +233,7 @@ doubleParameter
233233
identifierOrParameter
234234
: identifier
235235
| parameter
236-
| {this.isDevVersion()}? doubleParameter
236+
| doubleParameter
237237
;
238238

239239
limitCommand

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

Lines changed: 1 addition & 0 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ public enum Cap {
751751
/**
752752
* Use double parameter markers to represent field or function names.
753753
*/
754-
DOUBLE_PARAMETER_MARKERS_FOR_IDENTIFIERS(Build.current().isSnapshot()),
754+
DOUBLE_PARAMETER_MARKERS_FOR_IDENTIFIERS,
755755

756756
/**
757757
* Non full text functions do not contribute to score

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

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

0 commit comments

Comments
 (0)