- Added mv_median_absolute_deviation function - Added possibility of having a fixed param in Multivalue "ascending" functions - Add surrogate to MedianAbsoluteDeviation ### Calculations used to avoid overflows First, a quick recap of how the MAD is calculated: 1. Sort values, and get the median 2. Calculate the difference between each value with the median (`abs(median - value)`) 3. Sort the differences, and get their median Calculating a MAD may overflow when calculating the differences (Step 2), given the type is a signed number, as the difference is a positive value, with potentially the same value as `POSITIVE_MAX - NEGATIVE_MIN`. To solve this, some types are up-casted as follow: - Int: Stored as longs, simple approach - Long: Stored as longs, but switched to unsigned long representation when calculating the differences - Unsigned long: No effect; the resulting range is the same - Doubles: Nothing. If the values overflow to +/-infinity, they're left that way, as we'll just use those outliers to sort Closes https://github.com/elastic/elasticsearch/issues/111590 |
||
---|---|---|
.. | ||
appendix | ||
description | ||
examples | ||
kibana | ||
layout | ||
parameters | ||
signature | ||
types | ||
README.md | ||
aggregation-functions.asciidoc | ||
binary.asciidoc | ||
cast.asciidoc | ||
conditional-functions-and-expressions.asciidoc | ||
date-time-functions.asciidoc | ||
grouping-functions.asciidoc | ||
in.asciidoc | ||
ip-functions.asciidoc | ||
like.asciidoc | ||
logical.asciidoc | ||
math-functions.asciidoc | ||
mv-functions.asciidoc | ||
operators.asciidoc | ||
predicates.asciidoc | ||
rlike.asciidoc | ||
spatial-functions.asciidoc | ||
string-functions.asciidoc | ||
type-conversion-functions.asciidoc | ||
unary.asciidoc |
README.md
The files in these subdirectories are generated by ESQL's test suite:
description
- description of each function scraped from@FunctionInfo#description
examples
- examples of each function scraped from@FunctionInfo#examples
parameters
- description of each function's parameters scraped from@Param
signature
- railroad diagram of the syntax to invoke each functiontypes
- a table of each combination of support type for each parameter. These are generated from tests.layout
- a fully generated description for each functionkibana/definition
- function definitions for kibana's ESQL editorkibana/docs
- the inline docs for kibana
Most functions can use the generated docs generated in the layout
directory.
If we need something more custom for the function we can make a file in this
directory that can include::
any parts of the files above.
To regenerate the files for a function run its tests using gradle:
./gradlew :x-pack:plugin:esql:test -Dtests.class='*SinTests'
To regenerate the files for all functions run all of ESQL's tests using gradle:
./gradlew :x-pack:plugin:esql:test