ES|QL: Change FUSE KEY BY to receive a list of qualifiedName#139071
Merged
ioanatia merged 5 commits intoelastic:mainfrom Dec 9, 2025
Merged
ES|QL: Change FUSE KEY BY to receive a list of qualifiedName#139071ioanatia merged 5 commits intoelastic:mainfrom
ioanatia merged 5 commits intoelastic:mainfrom
Conversation
Collaborator
|
Hi @ioanatia, I've created a changelog YAML for you. |
Collaborator
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
ioanatia
commented
Dec 8, 2025
|
|
||
| expectError(queryPrefix + " | FUSE GROUP BY foo SCORE BY my_score LINEAR", "line 1:111: extraneous input 'LINEAR' expecting <EOF>"); | ||
|
|
||
| expectError(queryPrefix + " | FUSE KEY BY CONCAT(key1, key2)", "line 1:93: token recognition error at: '('"); |
Contributor
Author
There was a problem hiding this comment.
The KEY BY syntax is exercised in many existing tests already, see for example:
so I only need to add a statement tests to check that we raise a syntax error when the wrong syntax is used with KEY BY
afoucret
approved these changes
Dec 9, 2025
Contributor
afoucret
left a comment
There was a problem hiding this comment.
This grammar change is quite straightforward.
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.
Previously KEY BY was using
fieldswhich is actually used bySTATS ... BY.However, what we actually want for the FUSE keys is a list of
qualifiedName, whereasfieldscan also accept expressions likeconcat(field1, field2).I checked if something like
FUSE KEY BY concat(field1, field2)would actually work previously and it didn't - we still failed with a statement parser error, due to some mishandling ANTLR expression push mode for(.So even if the syntax looked like it should allow something like
concat(field1, field2), in reality this does not actually work even right now on main.