Commit graph

4 commits

Author SHA1 Message Date
Drew Tate
a75231ed53
[ES|QL] remove Kibana-side overwrites for mv_dedupe and coalesce (#185901)
With the resolution of
https://github.com/elastic/elasticsearch/issues/108982, we can use the
Elasticsearch definitions for `mv_dedupe` and `coalesce`!

We have also had a couple instances lately of people not noticing the
"auto-generated" warning at the top of the function definitions file. I
have sprinkled warnings throughout so that it's more clear that any
manual changes will be wiped out.
2024-06-11 09:55:17 -05:00
Kibana Machine
67940a2425
[ES|QL] Update function definitions (#184626)
This PR updates the function definitions based on the latest metadata
from Elasticsearch.

---------

Co-authored-by: Drew Tate <andrew.tate@elastic.co>
2024-06-05 11:56:03 -05:00
Drew Tate
cf1ff97c12
[ES|QL] add function definition sync to CI (#184225)
## Summary

Runs the script added in https://github.com/elastic/kibana/pull/179584
on the weekly schedule.

Successful run:
https://buildkite.com/elastic/kibana-es-ql-grammar-sync/builds/21#018fab3b-d051-4852-a03e-889cf156fb70/838

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2024-05-28 11:02:20 -05:00
Drew Tate
72d2a56019
[ES|QL] Generate function definitions from Elasticsearch metadata (#179584)
## Summary

Resolve https://github.com/elastic/kibana/issues/179634

This PR introduces a script to gather metadata from Elasticsearch and
build the function definitions for Kibana's client-side validation.

To run the script: `cd packages/kbn-esql-validation-autocomplete && yarn
makedefs path/to/elasticsearch/repo`

## Current limitations
### Things we can't (yet) gather from ES

#### Things that are currently being filled in on the Kibana side but
would be missing if we had to rely completely on ES
- function aliases (e.g. `to_str`)
- operators and aggs (issues for Elasticsearch
https://github.com/elastic/elasticsearch/issues/107219 and
https://github.com/elastic/elasticsearch/issues/107220)
- Kibana AST parameter settings
- `constantOnly` — whether a parameter can be a non-literal or not
(`percentile`, `auto_bucket`)
- `constantOptions`/`constantSuggestions` — specific information about
which constants are accepted or suggested for particular parameters.
- `supportsWildcard` — whether a parameter can contain `*` (only `count`
at the moment)
- `noNestingFunctions` — whether a parameter can contain nested
functions (used for all agg functions)
- Kibana date constant types
  - `chrono_literal`
  - `time_literal`

### Other considerations
- Asciidoc links need to be scrubbed (e.g. `Function
{wikipedia}/foo/bar[arccosine] returns blah blah`)
- As of https://github.com/elastic/elasticsearch/pull/106454 some
descriptions reference outdated parameter names and some parameter names
are questionable:
<img width="600" alt="Screenshot 2024-03-28 at 1 07 16 PM"
src="3b9ab457-e9fd-4c5f-afb2-23ae769bb44a">

_parameter `n` is now called `number`, but the description still calls
it `n`... also, is `number` really the best name for the variable?_

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [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>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-24 08:03:56 -05:00