-
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
EQL: Replace ` (back-tick) with ' (single quote) #62663
Comments
I think we need to continue to consider both Endgame users and Elasticsearch users. This hasn't been gone through a single release in either as deprecated feature. We deprecated it in a PR a few weeks ago, and are already trying to reuse it. From the user's POV, they'll see inconsistent behavior between Endgame and Elasticsearch, but also between Elasticsearch 7.9 and 7.10. If we leave it deprecated in 7.10, then we can later reuse it. But I still don't think I think this issue assumes agreement that I think we haven't had too many use cases of identifiers that don't match our existing regex: Since I've heard it said in these discussions that I think we should go with the most intuitive decision for past, present, and future users of EQL. In my mind |
Backtick is not a widely used symbol and definitely not more common than |
Let me add some more thoughts as well.
It seems quite inconvenient for the user to receive a message mentioning a wrong identifier for something that until now it was considered a string literal and I have a preference for the more clear 2 step approach (1. error message for single quotes around string, 2. replacement of backquotes with single quote for identifiers), but based on @astefan 's comment |
My biggest issue is that people have almost universally come to expect If we went forward with We can stick with our removal of |
We also have more options than just One more option that comes to mind is using backslashes to escape characters. This If you do that, it's crystal clear what is a string and what is a field:
We could extend this syntax: elasticsearch/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 Lines 215 to 218 in 8f94981
fragment IDENTIFIER_ESCAPE
// prohibit unnecessary alpha escapes, so we can later extend these (such as \uXXXX and \UXXXXXXXX)
: [\\] ([^A-Za-z\b\t\n\f\r]|[btnfr])
;
IDENTIFIER
: (LETTER | '_' | '@' | IDENTIFIER_ESCAPE) (LETTER | DIGIT | '_' | IDENTIFIER_ESCAPE)*
; |
That is incorrect. A beta means the feature set is locked but the implementation or some minor features not fully implemented. For the whole duration of the 7.x line. If The whole reason EQL in Elasticsearch 7.9 is experimental is to allow such breaking changes to occur.
I don't follow... Further more in practice, in EQL
User experience? Back-ticks are rarely used in declarative/query languages as oppose to single quotes which are. We have already experienced this internally where folks on the team used single quotes instead of backticks to define a field name in an EQL query which obviously failed. SQL might be quirky but it's the most popular declarative language and serves as a good analogy on when to use one over the other. Based on the Markdown/Slack conventions (which are markup* languages and have no notion of evaluation, identifiers, etc...), I would expect '`' to be used for raw string declaration (don't escape anything) as oppose to quoting identifiers. Since quoting identifiers is a best practice and virtually all our queries should use, picking a known character is desirable over a less known one that is visually similar.
That's a step backwards since instead of just quoting a field regardless of its value, one must now escape each problematic character in the name.
|
We would maintain our This wouldn't be breaking at all, but would merely extend the regex for identifier matching. And the "quotes mean strings" approach will make our lives and our user's lives easier. |
Pick a different special character, say ' ' Further more regex in parser are discouraged due to their greedy nature which leads to ambiguity.
They already do.. Not sure what you mean. |
By quotes mean strings, I'm referring to the existing bias in all sorts of languages for quote characters (both |
After discussing this topic, we concluded to:
Moving forward, the usage |
Currently
`
is used for quoting identifiers since'
was used for string declaration. Since #62458,'
has been freed (is currently deprecated) so we could replace ` with '.This is a breaking change however considering only 51 or 2.25% of our own Python EQL rules are affected per (#61659), the impact of this change is insignificant.
It thus makes sense for Elasticsearch EQL to do it now before entering beta in 7.10 otherwise
'
cannot be repurposed afterwards.Initial discussions took place in this thread #61659 (comment) and #62638 (review)
Further more, if there are concerns on the Python EQL front (which operators under completely different constrains, has a different release cycle, versions, etc..) why not proceed with a release that deprecated/disables the
'
before changing their meaning?The text was updated successfully, but these errors were encountered: