-
Notifications
You must be signed in to change notification settings - Fork 25k
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
ESQL: Improve grammar to allow identifiers with . #100740
Changes from 2 commits
d500538
6d7eaa7
0e4ecb1
93cd110
5affc07
b6ba7e8
d4a0029
64f191b
9a51c58
96d1675
830b436
5865a2c
649f769
a047074
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 100740 | ||
summary: "ESQL: Improve grammar to allow identifiers with" | ||
area: ES|QL | ||
type: bug | ||
issues: | ||
- 100312 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,10 @@ fragment EXPONENT | |
: [Ee] [+-]? DIGIT+ | ||
; | ||
|
||
fragment UNDERSCORE | ||
: '_' | ||
; | ||
|
||
STRING | ||
: '"' (ESCAPE_SEQUENCE | UNESCAPED_CHARS)* '"' | ||
| '"""' (~[\r\n])*? '"""' '"'? '"'? | ||
|
@@ -127,12 +131,15 @@ PERCENT : '%'; | |
OPENING_BRACKET : '[' -> pushMode(EXPRESSION), pushMode(EXPRESSION); | ||
CLOSING_BRACKET : ']' -> popMode, popMode; | ||
|
||
fragment UNQUOTED_ID_BODY | ||
: (LETTER | DIGIT | DOT | UNDERSCORE) | ||
; | ||
|
||
UNQUOTED_IDENTIFIER | ||
: LETTER (LETTER | DIGIT | '_')* | ||
: LETTER UNQUOTED_ID_BODY* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will allow digits inside "subfields", but not on the root field. For example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to allow unquoted identifiers that start with digits, though? If so, we'd at least have to disallow identifiers being all digits, no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
ES accepts both fields There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which we accept as long as the fields are quoted "123" - same with field above "a.1m.4321" is accepted; the problem is handling fields which are NOT quoted. |
||
// only allow @ at beginning of identifier to keep the option to allow @ as infix operator in the future | ||
// also, single `_` and `@` characters are not valid identifiers | ||
| ('_' | '@') (LETTER | DIGIT | '_')+ | ||
| (UNDERSCORE | '@') UNQUOTED_ID_BODY+ | ||
; | ||
|
||
QUOTED_IDENTIFIER | ||
|
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog didn't like the period.