-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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] Remove variadic functions' optional args from the output of show functions #106454
Conversation
…argNames and argTypes for variadic functions
Documentation preview: |
Pinging @elastic/es-analytical-engine (Team:Analytics) |
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.
Thank you @fang-xing-esql. It looks much better. And it's a LGTM.
There is one more thing we can improve and make things more consistent: at the moment the naming of all the arguments is inconsistent.
For example, concat
has string1
and string2
(which is ok) but other string manipulating functions have str
and newStr
.
Most of the numerical arguments are called n
, but there are functions (min
, max
...) that receive numerical arguments called field
.
There are also a lot of function that have a single argument called v
.
Can you please have these consistent in some form? For example:
- those arguments that are strings let's call them
string
,newString
,string2
etc - all the string numerical arguments let's call them
number
- all the generic arguments, maybe
field
I am open to suggestions, as long as things are consistent.
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.
Just few minor comments
.../src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Case.java
Outdated
Show resolved
Hide resolved
...sql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Concat.java
Show resolved
Hide resolved
…79584) ## Summary Resolve #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 elastic/elasticsearch#107219 and elastic/elasticsearch#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 elastic/elasticsearch#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="https://github.com/elastic/kibana/assets/315764/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>
Resolve #106346
The optional arguments of variadic functions are removed from optionalArgs, argNames and argTypes in the output of show functions, and the outputs are shown below.
The full signature of the functions are kept unchanged, with the optional arguments included, so that we can find the information of the optional arguments there. If needed the full signature can be changed too.