Skip to content

Commit 16458de

Browse files
No parentheses in unquoted index patterns
1 parent 3153195 commit 16458de

File tree

12 files changed

+2267
-2155
lines changed

12 files changed

+2267
-2155
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,12 @@ showCommand
251251
;
252252

253253
enrichCommand
254-
: ENRICH policyName=ENRICH_POLICY_NAME (ON matchField=qualifiedNamePattern)? (WITH enrichWithClause (COMMA enrichWithClause)*)?
254+
: ENRICH policyName=enrichPolicyName (ON matchField=qualifiedNamePattern)? (WITH enrichWithClause (COMMA enrichWithClause)*)?
255+
;
256+
257+
enrichPolicyName
258+
: ENRICH_POLICY_NAME
259+
| QUOTED_STRING
255260
;
256261

257262
enrichWithClause

x-pack/plugin/esql/src/main/antlr/lexer/Enrich.g4

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ENRICH_WITH : WITH -> type(WITH), pushMode(ENRICH_FIELD_MODE);
2424
// similar to that of an index
2525
// see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#indices-create-api-path-params
2626
fragment ENRICH_POLICY_NAME_BODY
27-
: ~[\\/?"<>| ,#\t\r\n:]
27+
: ~[\\/?"<>| ,#\t\r\n:()]
2828
;
2929
3030
ENRICH_POLICY_NAME
@@ -36,6 +36,8 @@ ENRICH_MODE_UNQUOTED_VALUE
3636
: ENRICH_POLICY_NAME -> type(ENRICH_POLICY_NAME)
3737
;
3838
39+
ENRICH_QUOTED_POLICY_NAME : QUOTED_STRING -> type(QUOTED_STRING);
40+
3941
ENRICH_LINE_COMMENT
4042
: LINE_COMMENT -> channel(HIDDEN)
4143
;

x-pack/plugin/esql/src/main/antlr/lexer/From.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ FROM_RP : RP -> type(RP), popMode;
2929
// in 8.14 ` were not allowed
3030
// this has been relaxed in 8.15 since " is used for quoting
3131
fragment UNQUOTED_SOURCE_PART
32-
: ~[:"=|,[\]/ \t\r\n]
32+
: ~[:"=|,[\]/() \t\r\n]
3333
| '/' ~[*/] // allow single / but not followed by another / or * which would start a comment -- used in index pattern date spec
3434
;
3535

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

Lines changed: 2 additions & 1 deletion
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/parser/EsqlBaseLexer.java

Lines changed: 1165 additions & 1160 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/parser/EsqlBaseParser.interp

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

0 commit comments

Comments
 (0)