[ES|QL] Source AST node parsing improvements and source selector parsing#217299
Merged
Conversation
Contributor
|
Pinging @elastic/kibana-esql (Team:ESQL) |
stratoula
approved these changes
Apr 7, 2025
Contributor
stratoula
left a comment
There was a problem hiding this comment.
Looks great, there is some additional work that needs to be done for the validation to work but I will follow up in another PR
Contributor
💚 Build Succeeded
Metrics [docs]Page load bundle
|
paulinashakirova
approved these changes
Apr 7, 2025
Contributor
paulinashakirova
left a comment
There was a problem hiding this comment.
SharedUX code lgtm
Contributor
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/14311467198 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Apr 7, 2025
…ing (elastic#217299) ## Summary - This PR introduces source selector (aka "component") parsing `FROM index::<selector>` - It also improves source cluster and index parsing `FROM <cluster>:<index>` - Previous cluster and index would be parsed as `string` now they are parsed as `ESQLStringLiteral` instead. This is more correct as any of those can take three forms, and `ESQLStringLiteral` handles all three forms: 1. unquoted string: `cluster:index` 2. single-double quoted string: `"cluster":"index"` 3. triple-double quote string: `"""cluster""":"""index""` - The `ESQLStringLiteral` now also supports *"unquoted strings"* in addition to single `"str"` and triple `"""str"""` quoted strings. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (cherry picked from commit 86fdbe5)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Apr 7, 2025
…r parsing (#217299) (#217345) # Backport This will backport the following commits from `main` to `8.x`: - [[ES|QL] Source AST node parsing improvements and source selector parsing (#217299)](#217299) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Vadim Kibana","email":"82822460+vadimkibana@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-07T14:11:10Z","message":"[ES|QL] Source AST node parsing improvements and source selector parsing (#217299)\n\n## Summary\n\n- This PR introduces source selector (aka \"component\") parsing `FROM\nindex::<selector>`\n- It also improves source cluster and index parsing `FROM\n<cluster>:<index>`\n- Previous cluster and index would be parsed as `string` now they are\nparsed as `ESQLStringLiteral` instead. This is more correct as any of\nthose can take three forms, and `ESQLStringLiteral` handles all three\nforms:\n 1. unquoted string: `cluster:index`\n 2. single-double quoted string: `\"cluster\":\"index\"`\n 3. triple-double quote string: `\"\"\"cluster\"\"\":\"\"\"index\"\"`\n- The `ESQLStringLiteral` now also supports *\"unquoted strings\"* in\naddition to single `\"str\"` and triple `\"\"\"str\"\"\"` quoted strings.\n\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"86fdbe5379bbe43036d503752ff502fc28718f4b","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["review","release_note:skip","Feature:ES|QL","Team:ESQL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL] Source AST node parsing improvements and source selector parsing","number":217299,"url":"https://github.com/elastic/kibana/pull/217299","mergeCommit":{"message":"[ES|QL] Source AST node parsing improvements and source selector parsing (#217299)\n\n## Summary\n\n- This PR introduces source selector (aka \"component\") parsing `FROM\nindex::<selector>`\n- It also improves source cluster and index parsing `FROM\n<cluster>:<index>`\n- Previous cluster and index would be parsed as `string` now they are\nparsed as `ESQLStringLiteral` instead. This is more correct as any of\nthose can take three forms, and `ESQLStringLiteral` handles all three\nforms:\n 1. unquoted string: `cluster:index`\n 2. single-double quoted string: `\"cluster\":\"index\"`\n 3. triple-double quote string: `\"\"\"cluster\"\"\":\"\"\"index\"\"`\n- The `ESQLStringLiteral` now also supports *\"unquoted strings\"* in\naddition to single `\"str\"` and triple `\"\"\"str\"\"\"` quoted strings.\n\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"86fdbe5379bbe43036d503752ff502fc28718f4b"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217299","number":217299,"mergeCommit":{"message":"[ES|QL] Source AST node parsing improvements and source selector parsing (#217299)\n\n## Summary\n\n- This PR introduces source selector (aka \"component\") parsing `FROM\nindex::<selector>`\n- It also improves source cluster and index parsing `FROM\n<cluster>:<index>`\n- Previous cluster and index would be parsed as `string` now they are\nparsed as `ESQLStringLiteral` instead. This is more correct as any of\nthose can take three forms, and `ESQLStringLiteral` handles all three\nforms:\n 1. unquoted string: `cluster:index`\n 2. single-double quoted string: `\"cluster\":\"index\"`\n 3. triple-double quote string: `\"\"\"cluster\"\"\":\"\"\"index\"\"`\n- The `ESQLStringLiteral` now also supports *\"unquoted strings\"* in\naddition to single `\"str\"` and triple `\"\"\"str\"\"\"` quoted strings.\n\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"86fdbe5379bbe43036d503752ff502fc28718f4b"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
baileycash-elastic
pushed a commit
to baileycash-elastic/kibana
that referenced
this pull request
Apr 7, 2025
…ing (elastic#217299) ## Summary - This PR introduces source selector (aka "component") parsing `FROM index::<selector>` - It also improves source cluster and index parsing `FROM <cluster>:<index>` - Previous cluster and index would be parsed as `string` now they are parsed as `ESQLStringLiteral` instead. This is more correct as any of those can take three forms, and `ESQLStringLiteral` handles all three forms: 1. unquoted string: `cluster:index` 2. single-double quoted string: `"cluster":"index"` 3. triple-double quote string: `"""cluster""":"""index""` - The `ESQLStringLiteral` now also supports *"unquoted strings"* in addition to single `"str"` and triple `"""str"""` quoted strings. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
FROM index::<selector>FROM <cluster>:<index>stringnow they are parsed asESQLStringLiteralinstead. This is more correct as any of those can take three forms, andESQLStringLiteralhandles all three forms:cluster:index"cluster":"index""""cluster""":"""index""ESQLStringLiteralnow also supports "unquoted strings" in addition to single"str"and triple"""str"""quoted strings.Checklist