[ES|QL] fix COALESCE validation#222425
Conversation
|
Pinging @elastic/kibana-esql (Team:ESQL) |
| return true; | ||
| } | ||
|
|
||
| if (item.literalType === 'keyword' && argType === 'text') { |
There was a problem hiding this comment.
It seems as this check can be a helper function as you are doing the same check multiple times. It will make it a bit more readable too
There was a problem hiding this comment.
I'll give this a try!
There was a problem hiding this comment.
Done in 93e1dc6
I originally didn't do this because the checks are slightly different for functions and other cases. But we don't need to be this picky. The result is the same and this is much nicer. Thank you!
There was a problem hiding this comment.
It looks much better, thanx Drew!
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Page load bundle
History
|
|
Forgot to mention, the same thing should be done for autocomplete, but it got a bit more involved so I will do it later. The validation bug is the priority. |
|
Starting backport for target branches: 8.19 |
## Summary A resolution to elastic#192255 (comment) ### 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 --------- Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co> (cherry picked from commit 90a7436)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.19`: - [[ES|QL] fix COALESCE validation (#222425)](#222425) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Drew Tate","email":"drew.tate@elastic.co"},"sourceCommit":{"committedDate":"2025-06-04T18:07:46Z","message":"[ES|QL] fix COALESCE validation (#222425)\n\n## Summary\n\nA resolution to\nhttps://github.com//issues/192255#issuecomment-2844145398\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\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"90a7436ecb771edca0542ab52434a60e69b65cf3","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:ES|QL","Team:ESQL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL] fix COALESCE validation","number":222425,"url":"https://github.com/elastic/kibana/pull/222425","mergeCommit":{"message":"[ES|QL] fix COALESCE validation (#222425)\n\n## Summary\n\nA resolution to\nhttps://github.com//issues/192255#issuecomment-2844145398\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\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"90a7436ecb771edca0542ab52434a60e69b65cf3"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222425","number":222425,"mergeCommit":{"message":"[ES|QL] fix COALESCE validation (#222425)\n\n## Summary\n\nA resolution to\nhttps://github.com//issues/192255#issuecomment-2844145398\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\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"90a7436ecb771edca0542ab52434a60e69b65cf3"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Drew Tate <drew.tate@elastic.co> Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
## Summary The autocomplete side of #222425 Also, cleans up and simplifies some unnecessarily-complicated autocomplete function test code, following the same pattern we used for function validation testing 💪 ### 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
## Summary The autocomplete side of elastic#222425 Also, cleans up and simplifies some unnecessarily-complicated autocomplete function test code, following the same pattern we used for function validation testing 💪 ### 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 1279bc9)
## Summary The autocomplete side of elastic#222425 Also, cleans up and simplifies some unnecessarily-complicated autocomplete function test code, following the same pattern we used for function validation testing 💪 ### 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
## Summary A resolution to elastic#192255 (comment) ### 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 --------- Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
## Summary The autocomplete side of elastic#222425 Also, cleans up and simplifies some unnecessarily-complicated autocomplete function test code, following the same pattern we used for function validation testing 💪 ### 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
Summary
A resolution to #192255 (comment)
There is no limit to the number of parameters that
COALESCEwill accept. This is expressed with thevariadicoption in the function definition from Elasticsearch.The problem with
variadicis that it specifies a single data type for all subsequent parameters. The function definition could include these two mixed signatures:keyword, text*text, keyword*(where the asterisk marks variadic)
And that would cover
keyword, text, text, text, ....text, keyword, keyword, keyword, ....But not
keyword, text, keywordfor example.To do that you'd we would need
keyword, text, keyword*in the function definition. But then that wouldn't coverkeyword, text, keyword, text.Ad infinitum.
Checklist