-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Disallow mixed quoted/unquoted patterns in FROM #127636
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
Merged
pawankartik-elastic
merged 14 commits into
elastic:main
from
alex-spies:esql-ccs-simplified-grammar
Jun 17, 2025
+1,323
−1,135
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1b00c47
Disallow mixed quoted/unquoted patterns in FROM
alex-spies 31177ad
Merge branch 'main' into esql-ccs-simplified-grammar
pawankartik-elastic a581962
Update logic and tests to conform to the new grammar
pawankartik-elastic 2036306
Merge branch 'main' into esql-ccs-simplified-grammar
pawankartik-elastic 2cabfcc
Auto generate parser files
pawankartik-elastic e608431
Try: fix bwc tests
pawankartik-elastic 12ddfb5
Merge branch 'main' into esql-ccs-simplified-grammar
pawankartik-elastic 79cdcf5
fix: regen parser
pawankartik-elastic 64e3af1
Add additional tests for LOOKUP JOIN
pawankartik-elastic 50f78a2
Merge branch 'main' into esql-ccs-simplified-grammar
pawankartik-elastic 28276d5
Update docs/changelog/127636.yaml
alex-spies cabf3a6
Update changelog with more details
pawankartik-elastic 676447a
Merge branch 'main' into esql-ccs-simplified-grammar
pawankartik-elastic d1fe1bc
Merge branch 'main' into esql-ccs-simplified-grammar
pawankartik-elastic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| pr: 127636 | ||
| summary: Disallow mixed quoted/unquoted patterns in FROM | ||
| area: ES|QL | ||
| type: breaking | ||
| issues: | ||
| - 122651 | ||
| breaking: | ||
| title: Disallow mixed quoted/unquoted patterns in FROM | ||
| area: ES|QL | ||
| details: "Previously, the ES|QL grammar allowed users to individually quote constituent strings in index patterns\ | ||
| \ such as \"remote_cluster\":\"index_name\". This would allow users to write complex malformed index patterns\ | ||
| \ that often slip through grammar and the subsequent validation. This could result in runtime errors\ | ||
| \ that can be misleading. This change simplifies the grammar to early reject such malformed index patterns\ | ||
| \ at the parsing stage, allowing users to write simpler queries and see more relevant and meaningful\ | ||
| \ errors." | ||
| impact: "Users can write queries with simpler index patterns and see more meaningful and relevant errors." | ||
| notable: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.interp
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is indexString used anywhere else?
If no, i wonder if that is going to be a bit more readable to have:
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.
Shouldn't
remote:index::databe supported as well?Uh oh!
There was an error while loading. Please reload this page.
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.
indexStringis definitely used. Consider:FROM "my_index_name". In this case, the index name is represented byindexStringand is aQUOTED_STRING. Look at line 128.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.
@idegtiarenko , your suggestion would be more compact and I considered this at first; but the current approach avoids
remote:index::datadirectly in the grammar - leaving less room for missing a validation, until selectors will be made available for remote indices.