[ES|QL] Fix validation on string implicit casting for dates and other minor issues#181571
Merged
stratoula merged 3 commits intoelastic:mainfrom Apr 25, 2024
Merged
Conversation
Contributor
Author
|
/ci |
Contributor
|
Pinging @elastic/kibana-esql (Team:ESQL) |
Contributor
|
/ci |
💚 Build Succeeded
Metrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Apr 25, 2024
… minor issues (elastic#181571) ## Summary Fixes validation for these scenarios where literal `string`s are implicit casted to the other type by ES: ``` from index | where "2022" == now() from index | where "2022" == 42 ``` Also, it solves a bug that let two dates being added/diff each other, like `eval now() - now()`. ### 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 cf8a7fa)
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 25, 2024
…d other minor issues (#181571) (#181669) # Backport This will backport the following commits from `main` to `8.14`: - [[ES|QL] Fix validation on string implicit casting for dates and other minor issues (#181571)](#181571) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Marco Liberati","email":"dej611@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-04-25T09:06:34Z","message":"[ES|QL] Fix validation on string implicit casting for dates and other minor issues (#181571)\n\n## Summary\r\n\r\nFixes validation for these scenarios where literal `string`s are\r\nimplicit casted to the other type by ES:\r\n\r\n```\r\nfrom index | where \"2022\" == now()\r\nfrom index | where \"2022\" == 42\r\n```\r\n\r\nAlso, it solves a bug that let two dates being added/diff each other,\r\nlike `eval now() - now()`.\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: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"cf8a7fa94b436f2f6c378a88410ce451cf641287","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:prev-minor","Feature:ES|QL","v8.14.0","Team:ESQL","v8.15.0"],"title":"[ES|QL] Fix validation on string implicit casting for dates and other minor issues","number":181571,"url":"https://github.com/elastic/kibana/pull/181571","mergeCommit":{"message":"[ES|QL] Fix validation on string implicit casting for dates and other minor issues (#181571)\n\n## Summary\r\n\r\nFixes validation for these scenarios where literal `string`s are\r\nimplicit casted to the other type by ES:\r\n\r\n```\r\nfrom index | where \"2022\" == now()\r\nfrom index | where \"2022\" == 42\r\n```\r\n\r\nAlso, it solves a bug that let two dates being added/diff each other,\r\nlike `eval now() - now()`.\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: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"cf8a7fa94b436f2f6c378a88410ce451cf641287"}},"sourceBranch":"main","suggestedTargetBranches":["8.14"],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/181571","number":181571,"mergeCommit":{"message":"[ES|QL] Fix validation on string implicit casting for dates and other minor issues (#181571)\n\n## Summary\r\n\r\nFixes validation for these scenarios where literal `string`s are\r\nimplicit casted to the other type by ES:\r\n\r\n```\r\nfrom index | where \"2022\" == now()\r\nfrom index | where \"2022\" == 42\r\n```\r\n\r\nAlso, it solves a bug that let two dates being added/diff each other,\r\nlike `eval now() - now()`.\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: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"cf8a7fa94b436f2f6c378a88410ce451cf641287"}}]}] BACKPORT--> Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
kpatticha
pushed a commit
to kpatticha/kibana
that referenced
this pull request
Apr 26, 2024
… minor issues (elastic#181571) ## Summary Fixes validation for these scenarios where literal `string`s are implicit casted to the other type by ES: ``` from index | where "2022" == now() from index | where "2022" == 42 ``` Also, it solves a bug that let two dates being added/diff each other, like `eval now() - now()`. ### 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>
Contributor
|
Linking with the originating Elasticsearch PR: elastic/elasticsearch#106932 |
5 tasks
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
Fixes validation for these scenarios where literal
strings are implicit casted to the other type by ES:Also, it solves a bug that let two dates being added/diff each other, like
eval now() - now().Checklist