-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ES|QL] Create expression type evaluator #195989
[ES|QL] Create expression type evaluator #195989
Conversation
…xpression-type-evaluator
…xpression-type-evaluator
Confirmed this PR also fixes the wrapped boolean expression are not always handled with their final type (part of #196618) 🥳 |
Pinging @elastic/kibana-esql (Team:ESQL) |
@drewdaemon I assumed you want to backport also in 8.16 so I will update the backport labels. Let me know if I assumed wrongly |
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.
This is a very nice fix, and makes the code more readable imho. I tested it quite thorougly I think. I cant find any regression so from me we are good to go. Nice job Drew.
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.
Also tested and LGTM 🎉
@elasticmachine merge upstream |
Starting backport for target branches: 8.16, 8.x |
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
|
## Summary Close elastic#195682 Close elastic#195430 Introduces `getExpressionType`, the ES|QL expression type evaluator to rule them all! Also, fixes several validation bugs related to the faulty logic that existed before with variable type detection (some noted in 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: Elastic Machine <[email protected]> (cherry picked from commit 2173af7)
## Summary Close elastic#195682 Close elastic#195430 Introduces `getExpressionType`, the ES|QL expression type evaluator to rule them all! Also, fixes several validation bugs related to the faulty logic that existed before with variable type detection (some noted in 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: Elastic Machine <[email protected]> (cherry picked from commit 2173af7)
💚 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.16`: - [[ES|QL] Create expression type evaluator (#195989)](#195989) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Drew Tate","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-18T16:15:11Z","message":"[ES|QL] Create expression type evaluator (#195989)\n\n## Summary\r\n\r\nClose https://github.com/elastic/kibana/issues/195682\r\nClose https://github.com/elastic/kibana/issues/195430\r\n\r\nIntroduces `getExpressionType`, the ES|QL expression type evaluator to\r\nrule them all!\r\n\r\nAlso, fixes several validation bugs related to the faulty logic that\r\nexisted before with variable type detection (some noted in\r\nhttps://github.com//issues/192255#issuecomment-2394613881).\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"2173af79fde374008b181ca42cf98a7137a7bb24","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Feature:ES|QL","Team:ESQL","v8.16.0","backport:version","v8.17.0"],"title":"[ES|QL] Create expression type evaluator","number":195989,"url":"https://github.com/elastic/kibana/pull/195989","mergeCommit":{"message":"[ES|QL] Create expression type evaluator (#195989)\n\n## Summary\r\n\r\nClose https://github.com/elastic/kibana/issues/195682\r\nClose https://github.com/elastic/kibana/issues/195430\r\n\r\nIntroduces `getExpressionType`, the ES|QL expression type evaluator to\r\nrule them all!\r\n\r\nAlso, fixes several validation bugs related to the faulty logic that\r\nexisted before with variable type detection (some noted in\r\nhttps://github.com//issues/192255#issuecomment-2394613881).\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"2173af79fde374008b181ca42cf98a7137a7bb24"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195989","number":195989,"mergeCommit":{"message":"[ES|QL] Create expression type evaluator (#195989)\n\n## Summary\r\n\r\nClose https://github.com/elastic/kibana/issues/195682\r\nClose https://github.com/elastic/kibana/issues/195430\r\n\r\nIntroduces `getExpressionType`, the ES|QL expression type evaluator to\r\nrule them all!\r\n\r\nAlso, fixes several validation bugs related to the faulty logic that\r\nexisted before with variable type detection (some noted in\r\nhttps://github.com//issues/192255#issuecomment-2394613881).\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"2173af79fde374008b181ca42cf98a7137a7bb24"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Drew Tate <[email protected]>
# Backport This will backport the following commits from `main` to `8.x`: - [[ES|QL] Create expression type evaluator (#195989)](#195989) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Drew Tate","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-18T16:15:11Z","message":"[ES|QL] Create expression type evaluator (#195989)\n\n## Summary\r\n\r\nClose https://github.com/elastic/kibana/issues/195682\r\nClose https://github.com/elastic/kibana/issues/195430\r\n\r\nIntroduces `getExpressionType`, the ES|QL expression type evaluator to\r\nrule them all!\r\n\r\nAlso, fixes several validation bugs related to the faulty logic that\r\nexisted before with variable type detection (some noted in\r\nhttps://github.com//issues/192255#issuecomment-2394613881).\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"2173af79fde374008b181ca42cf98a7137a7bb24","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Feature:ES|QL","Team:ESQL","v8.16.0","backport:version","v8.17.0"],"title":"[ES|QL] Create expression type evaluator","number":195989,"url":"https://github.com/elastic/kibana/pull/195989","mergeCommit":{"message":"[ES|QL] Create expression type evaluator (#195989)\n\n## Summary\r\n\r\nClose https://github.com/elastic/kibana/issues/195682\r\nClose https://github.com/elastic/kibana/issues/195430\r\n\r\nIntroduces `getExpressionType`, the ES|QL expression type evaluator to\r\nrule them all!\r\n\r\nAlso, fixes several validation bugs related to the faulty logic that\r\nexisted before with variable type detection (some noted in\r\nhttps://github.com//issues/192255#issuecomment-2394613881).\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"2173af79fde374008b181ca42cf98a7137a7bb24"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195989","number":195989,"mergeCommit":{"message":"[ES|QL] Create expression type evaluator (#195989)\n\n## Summary\r\n\r\nClose https://github.com/elastic/kibana/issues/195682\r\nClose https://github.com/elastic/kibana/issues/195430\r\n\r\nIntroduces `getExpressionType`, the ES|QL expression type evaluator to\r\nrule them all!\r\n\r\nAlso, fixes several validation bugs related to the faulty logic that\r\nexisted before with variable type detection (some noted in\r\nhttps://github.com//issues/192255#issuecomment-2394613881).\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"2173af79fde374008b181ca42cf98a7137a7bb24"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Drew Tate <[email protected]>
## Summary Follow-up from #195989. We discussed as a team and decided to show validation errors when an unknown variable is used as an argument to subsequent functions. **Before** <img width="589" alt="Screenshot 2024-10-22 at 1 41 08 PM" src="https://github.com/user-attachments/assets/872d3302-ddfe-415f-9c98-e2c682344189"> **After** <img width="570" alt="Screenshot 2024-10-22 at 1 41 29 PM" src="https://github.com/user-attachments/assets/b7e29c2d-ee40-4730-b1ab-43d95dfd264c">
## Summary Follow-up from elastic#195989. We discussed as a team and decided to show validation errors when an unknown variable is used as an argument to subsequent functions. **Before** <img width="589" alt="Screenshot 2024-10-22 at 1 41 08 PM" src="https://github.com/user-attachments/assets/872d3302-ddfe-415f-9c98-e2c682344189"> **After** <img width="570" alt="Screenshot 2024-10-22 at 1 41 29 PM" src="https://github.com/user-attachments/assets/b7e29c2d-ee40-4730-b1ab-43d95dfd264c"> (cherry picked from commit e1c0cef)
## Summary Follow-up from elastic#195989. We discussed as a team and decided to show validation errors when an unknown variable is used as an argument to subsequent functions. **Before** <img width="589" alt="Screenshot 2024-10-22 at 1 41 08 PM" src="https://github.com/user-attachments/assets/872d3302-ddfe-415f-9c98-e2c682344189"> **After** <img width="570" alt="Screenshot 2024-10-22 at 1 41 29 PM" src="https://github.com/user-attachments/assets/b7e29c2d-ee40-4730-b1ab-43d95dfd264c"> (cherry picked from commit e1c0cef)
Summary
Close #195682
Close #195430
Introduces
getExpressionType
, the ES|QL expression type evaluator to rule them all!Also, fixes several validation bugs related to the faulty logic that existed before with variable type detection (some noted in #192255 (comment)).
Checklist