ESQL: Grammar - FROM METADATA no longer require []#105221
ESQL: Grammar - FROM METADATA no longer require []#105221costin merged 13 commits intoelastic:mainfrom
Conversation
Remove usage of [ ] through-out the grammar, in this case inside FROM METADATA.
|
Documentation preview: |
|
Hi @costin, I've created a changelog YAML for you. Note that since this PR is labelled |
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
There was a problem hiding this comment.
Thanks Costin, LGTM.
For the failing tests (all the CSV tests that still use square brackets for metadata and that now expect a warning), my feeling is that there is no solution apart from skipping them for v < 8.13: warnings are checked as mandatory, so the tests will always fail in old versions, where the warning is not emitted
astefan
left a comment
There was a problem hiding this comment.
LGTM. Left some minor comments about wording.
| if (deprecatedContext != null) { | ||
| var s = source(deprecatedContext).source(); | ||
| addWarning( | ||
| "Line {}:{}: Square brackets '[]' need to be removed in FROM METADATA declaration", |
There was a problem hiding this comment.
| "Line {}:{}: Square brackets '[]' need to be removed in FROM METADATA declaration", | |
| "Line {}:{}: Square brackets '[]' need to be removed from FROM METADATA declaration", |
|
Thanks for the reviews folks - I've updated the test and raised #105267 |
## Summary Sync with elastic/elasticsearch#104958 for support of builtin fn in STATS * validation ✅ * autocomplete ✅ * also fixed `STATS BY <field>` syntax  Sync with elastic/elasticsearch#104913 for new `log` function * validation ✅ - also warning for negative values * autocomplete ✅  Sync with elastic/elasticsearch#105064 for removal of `PROJECT` command * validation ✅ (both new and legacy syntax supported) * autocomplete ✅ (will only suggest new syntax)  Sync with elastic/elasticsearch#105221 for removal of mandatory brackets for `METADATA` command option * validation ✅ (added warning deprecation message when using brackets) * autocomplete ✅  Sync with elastic/elasticsearch#105224 for change of syntax for ENRICH ccq mode * validation ✅ * autocomplete ✅ (not directly promoted, the user has to type `_` to trigger it) * hover ✅ * code actions ✅   Do not merge until those 5 get merged. Additional things in this PR: * Added more tests for `callbacks` not passed scenario * covered more cases like those with `dissect` * Added more tests for signature params number (calling a function with an extra arg should return an error) * Cleaned up some more unused code * Improved messages on too many arguments for functions ### 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 Sync with elastic/elasticsearch#104958 for support of builtin fn in STATS * validation ✅ * autocomplete ✅ * also fixed `STATS BY <field>` syntax  Sync with elastic/elasticsearch#104913 for new `log` function * validation ✅ - also warning for negative values * autocomplete ✅  Sync with elastic/elasticsearch#105064 for removal of `PROJECT` command * validation ✅ (both new and legacy syntax supported) * autocomplete ✅ (will only suggest new syntax)  Sync with elastic/elasticsearch#105221 for removal of mandatory brackets for `METADATA` command option * validation ✅ (added warning deprecation message when using brackets) * autocomplete ✅  Sync with elastic/elasticsearch#105224 for change of syntax for ENRICH ccq mode * validation ✅ * autocomplete ✅ (not directly promoted, the user has to type `_` to trigger it) * hover ✅ * code actions ✅   Do not merge until those 5 get merged. Additional things in this PR: * Added more tests for `callbacks` not passed scenario * covered more cases like those with `dissect` * Added more tests for signature params number (calling a function with an extra arg should return an error) * Cleaned up some more unused code * Improved messages on too many arguments for functions ### 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 Sync with elastic/elasticsearch#104958 for support of builtin fn in STATS * validation ✅ * autocomplete ✅ * also fixed `STATS BY <field>` syntax  Sync with elastic/elasticsearch#104913 for new `log` function * validation ✅ - also warning for negative values * autocomplete ✅  Sync with elastic/elasticsearch#105064 for removal of `PROJECT` command * validation ✅ (both new and legacy syntax supported) * autocomplete ✅ (will only suggest new syntax)  Sync with elastic/elasticsearch#105221 for removal of mandatory brackets for `METADATA` command option * validation ✅ (added warning deprecation message when using brackets) * autocomplete ✅  Sync with elastic/elasticsearch#105224 for change of syntax for ENRICH ccq mode * validation ✅ * autocomplete ✅ (not directly promoted, the user has to type `_` to trigger it) * hover ✅ * code actions ✅   Do not merge until those 5 get merged. Additional things in this PR: * Added more tests for `callbacks` not passed scenario * covered more cases like those with `dissect` * Added more tests for signature params number (calling a function with an extra arg should return an error) * Cleaned up some more unused code * Improved messages on too many arguments for functions ### 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
Remove usage of [ ] through-out the grammar, in this case inside
FROM METADATA.