-
Notifications
You must be signed in to change notification settings - Fork 8k
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] Client side validation misconfiguration #177699
Comments
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
## Summary Related issue #177699 Fix variables logic for expressions at `stats by ...` level. Fix validation logic for agg functions within `eval` or `where` scope. Fix validation and autocomplete logic for nested quoted expressions * i.e. ``` from index | eval round(numberField) + 1 | eval `round(numberField) + 1` + 1 | eval ```round(numberField) + 1`` + 1` + 1 | eval ```````round(numberField) + 1```` + 1`` + 1` + 1 | eval ```````````````round(numberField) + 1```````` + 1```` + 1`` + 1` + 1 | keep ```````````````````````````````round(numberField) + 1```````````````` + 1```````` + 1```` + 1`` + 1` ``` * updated `count_distinct` agg definition to have the `precision` second optional param. ### 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 Related issue elastic#177699 Fix variables logic for expressions at `stats by ...` level. Fix validation logic for agg functions within `eval` or `where` scope. Fix validation and autocomplete logic for nested quoted expressions * i.e. ``` from index | eval round(numberField) + 1 | eval `round(numberField) + 1` + 1 | eval ```round(numberField) + 1`` + 1` + 1 | eval ```````round(numberField) + 1```` + 1`` + 1` + 1 | eval ```````````````round(numberField) + 1```````` + 1```` + 1`` + 1` + 1 | keep ```````````````````````````````round(numberField) + 1```````````````` + 1```````` + 1```` + 1`` + 1` ``` * updated `count_distinct` agg definition to have the `precision` second optional param. ### 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 cad276f) # Conflicts: # packages/kbn-monaco/src/esql/lib/ast/validation/esql_validation_meta_tests.json
## Summary Part of #177699 We had `case` marked as if it required three parameters when in reality it only requires two. <img width="600" alt="Screenshot 2024-03-19 at 4 23 29 PM" src="https://github.com/elastic/kibana/assets/315764/45f7578a-e6ad-4ba9-b71a-05bb1978a384"> Note: we could consider testing these n-1 cases to prevent this kind of bug in the future. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
## Summary Part of elastic#177699 We had `case` marked as if it required three parameters when in reality it only requires two. <img width="600" alt="Screenshot 2024-03-19 at 4 23 29 PM" src="https://github.com/elastic/kibana/assets/315764/45f7578a-e6ad-4ba9-b71a-05bb1978a384"> Note: we could consider testing these n-1 cases to prevent this kind of bug in the future. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com> (cherry picked from commit 28277c2) # Conflicts: # packages/kbn-monaco/src/esql/lib/ast/validation/esql_validation_meta_tests.json
# Backport This will backport the following commits from `main` to `8.13`: - [[ES|QL] case only requires two parameters (#179011)](#179011) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Drew Tate","email":"drew.tate@elastic.co"},"sourceCommit":{"committedDate":"2024-03-21T14:34:38Z","message":"[ES|QL] case only requires two parameters (#179011)\n\n## Summary\r\n\r\nPart of #177699 had `case` marked as if it required three parameters when in reality\r\nit only requires two.\r\n\r\n<img width=\"600\" alt=\"Screenshot 2024-03-19 at 4 23 29 PM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/315764/45f7578a-e6ad-4ba9-b71a-05bb1978a384\">\r\n\r\nNote: we could consider testing these n-1 cases to prevent this kind of\r\nbug in the future.\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>","sha":"28277c25df26796a8aa51cb4b8e82b0483c9cf83","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:prev-minor","v8.14.0"],"number":179011,"url":"#179011 case only requires two parameters (#179011)\n\n## Summary\r\n\r\nPart of #177699 had `case` marked as if it required three parameters when in reality\r\nit only requires two.\r\n\r\n<img width=\"600\" alt=\"Screenshot 2024-03-19 at 4 23 29 PM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/315764/45f7578a-e6ad-4ba9-b71a-05bb1978a384\">\r\n\r\nNote: we could consider testing these n-1 cases to prevent this kind of\r\nbug in the future.\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>","sha":"28277c25df26796a8aa51cb4b8e82b0483c9cf83"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.14.0","labelRegex":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"#179011 case only requires two parameters (#179011)\n\n## Summary\r\n\r\nPart of #177699 had `case` marked as if it required three parameters when in reality\r\nit only requires two.\r\n\r\n<img width=\"600\" alt=\"Screenshot 2024-03-19 at 4 23 29 PM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/315764/45f7578a-e6ad-4ba9-b71a-05bb1978a384\">\r\n\r\nNote: we could consider testing these n-1 cases to prevent this kind of\r\nbug in the future.\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>","sha":"28277c25df26796a8aa51cb4b8e82b0483c9cf83"}}]}] BACKPORT-->
# Backport This will backport the following commits from `main` to `8.13`: - [[ES|QL] Fix some validation misconfiguration (#177783)](#177783) <!--- Backport version: 8.9.8 --> ### 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-03-07T12:57:27Z","message":"[ES|QL] Fix some validation misconfiguration (#177783)\n\n## Summary\r\n\r\nRelated issue #177699\r\n\r\nFix variables logic for expressions at `stats by ...` level.\r\nFix validation logic for agg functions within `eval` or `where` scope.\r\nFix validation and autocomplete logic for nested quoted expressions\r\n * i.e. \r\n ```\r\nfrom index | eval round(numberField) + 1 | eval `round(numberField) + 1`\r\n+ 1 | eval ```round(numberField) + 1`` + 1` + 1 | eval\r\n```````round(numberField) + 1```` + 1`` + 1` + 1 | eval\r\n```````````````round(numberField) + 1```````` + 1```` + 1`` + 1` + 1 |\r\nkeep ```````````````````````````````round(numberField) +\r\n1```````````````` + 1```````` + 1```` + 1`` + 1`\r\n ```\r\n* updated `count_distinct` agg definition to have the `precision` second\r\noptional param.\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":"cad276fcbd9fe5b13c18f08fd01bcf0c802b7ec9","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","backport:prev-minor","Feature:ES|QL","v8.13.0","v8.14.0"],"number":177783,"url":"#177783 Fix some validation misconfiguration (#177783)\n\n## Summary\r\n\r\nRelated issue #177699\r\n\r\nFix variables logic for expressions at `stats by ...` level.\r\nFix validation logic for agg functions within `eval` or `where` scope.\r\nFix validation and autocomplete logic for nested quoted expressions\r\n * i.e. \r\n ```\r\nfrom index | eval round(numberField) + 1 | eval `round(numberField) + 1`\r\n+ 1 | eval ```round(numberField) + 1`` + 1` + 1 | eval\r\n```````round(numberField) + 1```` + 1`` + 1` + 1 | eval\r\n```````````````round(numberField) + 1```````` + 1```` + 1`` + 1` + 1 |\r\nkeep ```````````````````````````````round(numberField) +\r\n1```````````````` + 1```````` + 1```` + 1`` + 1`\r\n ```\r\n* updated `count_distinct` agg definition to have the `precision` second\r\noptional param.\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":"cad276fcbd9fe5b13c18f08fd01bcf0c802b7ec9"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","labelRegex":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"#177783 Fix some validation misconfiguration (#177783)\n\n## Summary\r\n\r\nRelated issue #177699\r\n\r\nFix variables logic for expressions at `stats by ...` level.\r\nFix validation logic for agg functions within `eval` or `where` scope.\r\nFix validation and autocomplete logic for nested quoted expressions\r\n * i.e. \r\n ```\r\nfrom index | eval round(numberField) + 1 | eval `round(numberField) + 1`\r\n+ 1 | eval ```round(numberField) + 1`` + 1` + 1 | eval\r\n```````round(numberField) + 1```` + 1`` + 1` + 1 | eval\r\n```````````````round(numberField) + 1```````` + 1```` + 1`` + 1` + 1 |\r\nkeep ```````````````````````````````round(numberField) +\r\n1```````````````` + 1```````` + 1```` + 1`` + 1`\r\n ```\r\n* updated `count_distinct` agg definition to have the `precision` second\r\noptional param.\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":"cad276fcbd9fe5b13c18f08fd01bcf0c802b7ec9"}}]}] BACKPORT--> Co-authored-by: Marco Liberati <dej611@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Pinging @elastic/kibana-esql (Team:ESQL) |
…79707) ## Summary Part of #177699 `AND` and `OR` were not accepting `NULL` as an argument when they should have. The most basic test case is `ROW var = TRUE or NULL`. ### 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>
Added problem case: |
Nice catch! |
This is a legacy problem. ES has been accepting them casting any non-boolean values as |
I think the latter addition |
I went checking the ES annotations for Max but it's not mention any Also the documentation seems to not mention Given the work on auto sync the signatures from ES, it is probably worth notifying this thing to them as well, to avoid regressions. |
There are no date tests for the |
## Summary This is a follow-on from elastic/elasticsearch#107859. Two main changes to our client-side validation code. 1. comparison operators like `==` and `>=` now support implicit casting from strings for `version`, `ip`, and `boolean` types 2. `in` and `not in` operators support implicit casting from strings for `version`, `ip`, `boolean`, and `date` constants. To address this quickly, I have disabled type-checking for array values (e.g. `in ( version_field, "1.2.3", "2.3.1" )`) because our parameter typing system does not currently support arrays of mixed types which it will need to in order to re-enable checking while allowing string literals. I have added this to #177699 ### A note on testing These implicit casting changes may not be on the latest Elasticsearch snapshot. Instead, check out the `8.14` branch in a local Elasticsearch repo and run `yarn es source --source-path='path/to/elasticsearch'` See [these tests](https://github.com/elastic/kibana/pull/182989/files#diff-89c4af0faedcf80d51cfb19ae397a5898c7293055b19284a94cb3f6a7cd4d071R1727-R1763) for a set of good use cases to try. `to_<type>` functions can be used if the sample data doesn't contain a field of the type you want to test. ### A note on string to date casting In #182856 we started accepting string literals for any function arguments that are dates. By the same logic, `"2022" - 1 day` would work, so our validator doesn't complain about it. However, it currently fails at the Elasticsearch level. In a discussion with Fang, we determined that this is a valid use case, so I have created elastic/elasticsearch#108432 and determined not to tighten the client-side validation since this seems more like a casting "hole" that will soon be filled in on the ES side (though not in 8.14). ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or
## Summary This is a follow-on from elastic/elasticsearch#107859. Two main changes to our client-side validation code. 1. comparison operators like `==` and `>=` now support implicit casting from strings for `version`, `ip`, and `boolean` types 2. `in` and `not in` operators support implicit casting from strings for `version`, `ip`, `boolean`, and `date` constants. To address this quickly, I have disabled type-checking for array values (e.g. `in ( version_field, "1.2.3", "2.3.1" )`) because our parameter typing system does not currently support arrays of mixed types which it will need to in order to re-enable checking while allowing string literals. I have added this to elastic#177699 ### A note on testing These implicit casting changes may not be on the latest Elasticsearch snapshot. Instead, check out the `8.14` branch in a local Elasticsearch repo and run `yarn es source --source-path='path/to/elasticsearch'` See [these tests](https://github.com/elastic/kibana/pull/182989/files#diff-89c4af0faedcf80d51cfb19ae397a5898c7293055b19284a94cb3f6a7cd4d071R1727-R1763) for a set of good use cases to try. `to_<type>` functions can be used if the sample data doesn't contain a field of the type you want to test. ### A note on string to date casting In elastic#182856 we started accepting string literals for any function arguments that are dates. By the same logic, `"2022" - 1 day` would work, so our validator doesn't complain about it. However, it currently fails at the Elasticsearch level. In a discussion with Fang, we determined that this is a valid use case, so I have created elastic/elasticsearch#108432 and determined not to tighten the client-side validation since this seems more like a casting "hole" that will soon be filled in on the ES side (though not in 8.14). ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or (cherry picked from commit c3e1027)
# Backport This will backport the following commits from `main` to `8.14`: - [[ES|QL] implicit casting changes (#182989)](#182989) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Drew Tate","email":"drew.tate@elastic.co"},"sourceCommit":{"committedDate":"2024-05-09T05:51:18Z","message":"[ES|QL] implicit casting changes (#182989)\n\n## Summary\r\n\r\nThis is a follow-on from\r\nhttps://github.com/elastic/elasticsearch/pull/107859.\r\n\r\nTwo main changes to our client-side validation code.\r\n1. comparison operators like `==` and `>=` now support implicit casting\r\nfrom strings for `version`, `ip`, and `boolean` types\r\n\r\n2. `in` and `not in` operators support implicit casting from strings for\r\n`version`, `ip`, `boolean`, and `date` constants. To address this\r\nquickly, I have disabled type-checking for array values (e.g. `in (\r\nversion_field, \"1.2.3\", \"2.3.1\" )`) because our parameter typing system\r\ndoes not currently support arrays of mixed types which it will need to\r\nin order to re-enable checking while allowing string literals. I have\r\nadded this to #177699 A note on testing\r\n\r\nThese implicit casting changes may not be on the latest Elasticsearch\r\nsnapshot. Instead, check out the `8.14` branch in a local Elasticsearch\r\nrepo and run `yarn es source --source-path='path/to/elasticsearch'`\r\n\r\nSee [these\r\ntests](https://github.com/elastic/kibana/pull/182989/files#diff-89c4af0faedcf80d51cfb19ae397a5898c7293055b19284a94cb3f6a7cd4d071R1727-R1763)\r\nfor a set of good use cases to try. `to_<type>` functions can be used if\r\nthe sample data doesn't contain a field of the type you want to test.\r\n\r\n### A note on string to date casting\r\n\r\nIn #182856 we started accepting\r\nstring literals for any function arguments that are dates.\r\n\r\nBy the same logic, `\"2022\" - 1 day` would work, so our validator doesn't\r\ncomplain about it. However, it currently fails at the Elasticsearch\r\nlevel.\r\n\r\nIn a discussion with Fang, we determined that this is a\r\nvalid use case, so I have created\r\nhttps://github.com/elastic/elasticsearch/issues/108432 and determined\r\nnot to tighten the client-side validation since this seems more like a\r\ncasting \"hole\" that will soon be filled in on the ES side (though not in\r\n8.14).\r\n\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","sha":"c3e1027b2d5da9361251e3af3304098717193ded","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","backport:prev-minor","Feature:ES|QL","v8.14.0","Team:ESQL","v8.15.0"],"title":"[ES|QL] implicit casting changes","number":182989,"url":"#182989 implicit casting changes (#182989)\n\n## Summary\r\n\r\nThis is a follow-on from\r\nhttps://github.com/elastic/elasticsearch/pull/107859.\r\n\r\nTwo main changes to our client-side validation code.\r\n1. comparison operators like `==` and `>=` now support implicit casting\r\nfrom strings for `version`, `ip`, and `boolean` types\r\n\r\n2. `in` and `not in` operators support implicit casting from strings for\r\n`version`, `ip`, `boolean`, and `date` constants. To address this\r\nquickly, I have disabled type-checking for array values (e.g. `in (\r\nversion_field, \"1.2.3\", \"2.3.1\" )`) because our parameter typing system\r\ndoes not currently support arrays of mixed types which it will need to\r\nin order to re-enable checking while allowing string literals. I have\r\nadded this to #177699 A note on testing\r\n\r\nThese implicit casting changes may not be on the latest Elasticsearch\r\nsnapshot. Instead, check out the `8.14` branch in a local Elasticsearch\r\nrepo and run `yarn es source --source-path='path/to/elasticsearch'`\r\n\r\nSee [these\r\ntests](https://github.com/elastic/kibana/pull/182989/files#diff-89c4af0faedcf80d51cfb19ae397a5898c7293055b19284a94cb3f6a7cd4d071R1727-R1763)\r\nfor a set of good use cases to try. `to_<type>` functions can be used if\r\nthe sample data doesn't contain a field of the type you want to test.\r\n\r\n### A note on string to date casting\r\n\r\nIn #182856 we started accepting\r\nstring literals for any function arguments that are dates.\r\n\r\nBy the same logic, `\"2022\" - 1 day` would work, so our validator doesn't\r\ncomplain about it. However, it currently fails at the Elasticsearch\r\nlevel.\r\n\r\nIn a discussion with Fang, we determined that this is a\r\nvalid use case, so I have created\r\nhttps://github.com/elastic/elasticsearch/issues/108432 and determined\r\nnot to tighten the client-side validation since this seems more like a\r\ncasting \"hole\" that will soon be filled in on the ES side (though not in\r\n8.14).\r\n\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","sha":"c3e1027b2d5da9361251e3af3304098717193ded"}},"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":"#182989 implicit casting changes (#182989)\n\n## Summary\r\n\r\nThis is a follow-on from\r\nhttps://github.com/elastic/elasticsearch/pull/107859.\r\n\r\nTwo main changes to our client-side validation code.\r\n1. comparison operators like `==` and `>=` now support implicit casting\r\nfrom strings for `version`, `ip`, and `boolean` types\r\n\r\n2. `in` and `not in` operators support implicit casting from strings for\r\n`version`, `ip`, `boolean`, and `date` constants. To address this\r\nquickly, I have disabled type-checking for array values (e.g. `in (\r\nversion_field, \"1.2.3\", \"2.3.1\" )`) because our parameter typing system\r\ndoes not currently support arrays of mixed types which it will need to\r\nin order to re-enable checking while allowing string literals. I have\r\nadded this to #177699 A note on testing\r\n\r\nThese implicit casting changes may not be on the latest Elasticsearch\r\nsnapshot. Instead, check out the `8.14` branch in a local Elasticsearch\r\nrepo and run `yarn es source --source-path='path/to/elasticsearch'`\r\n\r\nSee [these\r\ntests](https://github.com/elastic/kibana/pull/182989/files#diff-89c4af0faedcf80d51cfb19ae397a5898c7293055b19284a94cb3f6a7cd4d071R1727-R1763)\r\nfor a set of good use cases to try. `to_<type>` functions can be used if\r\nthe sample data doesn't contain a field of the type you want to test.\r\n\r\n### A note on string to date casting\r\n\r\nIn #182856 we started accepting\r\nstring literals for any function arguments that are dates.\r\n\r\nBy the same logic, `\"2022\" - 1 day` would work, so our validator doesn't\r\ncomplain about it. However, it currently fails at the Elasticsearch\r\nlevel.\r\n\r\nIn a discussion with Fang, we determined that this is a\r\nvalid use case, so I have created\r\nhttps://github.com/elastic/elasticsearch/issues/108432 and determined\r\nnot to tighten the client-side validation since this seems more like a\r\ncasting \"hole\" that will soon be filled in on the ES side (though not in\r\n8.14).\r\n\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","sha":"c3e1027b2d5da9361251e3af3304098717193ded"}}]}] BACKPORT--> Co-authored-by: Drew Tate <drew.tate@elastic.co>
@sphilipse thanks for the report |
Pretty much all functions and operators can accept |
We aren't catching nested aggregation functions (e.g. |
Kibana version:
8.13
In 8.13 we are introducing the client side validation which unfortunately is prone to human error. The entire functionality relies on our interpretation of the ES syntax so there are cases where we might highlight something as an error while it is not. I am going to gather all the problems I find here.
Using an agg function in a WHERE/EVAL context with a comparison operator doesn't flag it as unsupported. i.e.
... | eval avg(bytes) > 0
is ok, while... | eval avg(bytes)
is flagged correctly.case
requires 3 arguments in Kibana, but only 2 in Elasticsearch. ([ES|QL] case only requires two parameters #179011)multiple wildcards are marked as an error ([ES|QL] Fix wilcard complex scenarios #178938)
from kibana_sample_data_flights | limit 10 | stats var1 = count(Dest == "gr" or null)
This complains ([ES|QL] client-side validation: makeand
andor
acceptnull
#179707)from kibana_sample_data_logs | where 23
—where
shouldn't accept non-boolean expressionsfrom index | stats max(<date_field>)
complains — [ES|QL] max and min accept date fields #180945[ES|QL] accept hidden indices in validation #180807
bucket
has a new call-signature and its rules of use are different ESQL: extend BUCKET with spans. Turn it into a grouping function elasticsearch#107272 (8.14)Add
::
operator (added to ES in ESQL: Introduce a casting operator,::
elasticsearch#107409 — 8.15)Case variables are reported wrong
string (literals only) are implicitly casted as dates when the other side is a date
from kibana_sample_data_logs | limit 10 | where @timestamp == "2022-04-04"
+
and-
operations are not allowed between two dates [ES|QL] Fix validation on string implicit casting for dates and other minor issues #181571sort
should accept eval functions as arguments: ESQL: Allow grouping key inside stats expressions elasticsearch#106579date function params should accept strings ref [ES|QL] accept string constants for date args #182856
validation is disabled for
in
andnot in
arrays (as of [ES|QL] implicit casting changes #182989)index patterns with a negative are marked as invalid (
*,-.*
) ([ES|QL] accept negated index patterns #184528)all function and operator parameters can be
null
([ES|QL] accept null values for function arguments #184254)Here b is not valid as stats is not using it
from kibana_sample_data_logs | stats avg(to_long(avg(1)))
) — [ES|QL]METRICS
command definition and validation #184905The text was updated successfully, but these errors were encountered: