elasticsearch/docs/reference/esql/functions
Luigi Dell'Aquila 5f6e8f687b
ES|QL: add MV_APPEND function (#107001)
Adding `MV_APPEND(value1, value2)` function, that appends two values
creating a single multi-value. If one or both the inputs are
multi-values, the result is the concatenation of all the values, eg.

```
MV_APPEND([a, b], [c, d]) -> [a, b, c, d]
```

~I think for this specific case it makes sense to consider `null` values
as empty arrays, so that~ ~MV_APPEND(value, null) -> value~ ~It is
pretty uncommon for ESQL (all the other functions, apart from
`COALESCE`, short-circuit to `null` when one of the values is null), so
let's discuss this behavior.~

[EDIT] considering the feedback from Andrei, I changed this logic and
made it consistent with the other functions: now if one of the
parameters is null, the function returns null
2024-06-05 03:42:29 +10:00
..
description ES|QL: add MV_APPEND function (#107001) 2024-06-05 03:42:29 +10:00
examples ESQL: Add ip_prefix function (#109070) 2024-05-29 10:23:45 -04:00
kibana ES|QL: add MV_APPEND function (#107001) 2024-06-05 03:42:29 +10:00
layout ES|QL: add MV_APPEND function (#107001) 2024-06-05 03:42:29 +10:00
parameters ES|QL: add MV_APPEND function (#107001) 2024-06-05 03:42:29 +10:00
signature ES|QL: add MV_APPEND function (#107001) 2024-06-05 03:42:29 +10:00
types ES|QL: add MV_APPEND function (#107001) 2024-06-05 03:42:29 +10:00
aggregation-functions.asciidoc ESQL: Document BUCKET as a grouping function (#107864) 2024-04-25 12:38:12 -04:00
avg.asciidoc [DOCS] Support for nested functions in ES|QL STATS...BY (#104788) 2024-01-30 19:29:12 +01:00
binary.asciidoc ESQL: Generate more docs (#106367) 2024-03-19 15:40:13 -04:00
case.asciidoc [DOCS] Improve ES|QL functions reference for functions A-D (#103447) 2023-12-19 15:59:02 +01:00
cast.asciidoc ESQL: Document the cast operator (::) (#107871) 2024-04-25 10:10:59 -04:00
conditional-functions-and-expressions.asciidoc [ES|QL] Add/Modify annotations for spatial and conditional functions for better doc generation (#107722) 2024-05-10 14:49:25 -04:00
count-distinct.asciidoc [DOCS] Support for nested functions in ES|QL STATS...BY (#104788) 2024-01-30 19:29:12 +01:00
count.asciidoc [DOCS] Support for nested functions in ES|QL STATS...BY (#104788) 2024-01-30 19:29:12 +01:00
date-time-functions.asciidoc ES|QL: Add unit tests for now() function (#108498) 2024-05-10 14:28:19 +02:00
grouping-functions.asciidoc ESQL: Document BUCKET as a grouping function (#107864) 2024-04-25 12:38:12 -04:00
in.asciidoc [DOCS] Examples for ES|QL DISSECT and WHERE (#102591) 2023-11-27 10:56:48 +01:00
ip-functions.asciidoc Introduce an IP functions group (#108304) 2024-05-06 13:43:30 +02:00
like.asciidoc [ES|QL] Add/Modify annotations for operators for better doc generation (#108220) 2024-05-03 22:59:51 -04:00
logical.asciidoc Restructure ES|QL docs (#100806) 2023-10-17 17:36:14 +02:00
math-functions.asciidoc ESQL: CBRT function (#108574) 2024-05-15 16:50:15 +02:00
max.asciidoc [DOCS] Support for nested functions in ES|QL STATS...BY (#104788) 2024-01-30 19:29:12 +01:00
median-absolute-deviation.asciidoc [DOCS] Support for nested functions in ES|QL STATS...BY (#104788) 2024-01-30 19:29:12 +01:00
median.asciidoc [DOCS] Support for nested functions in ES|QL STATS...BY (#104788) 2024-01-30 19:29:12 +01:00
min.asciidoc [DOCS] Support for nested functions in ES|QL STATS...BY (#104788) 2024-01-30 19:29:12 +01:00
mv-functions.asciidoc mv functions (#107839) 2024-05-01 10:47:22 -04:00
operators.asciidoc Introduce an IP functions group (#108304) 2024-05-06 13:43:30 +02:00
percentile.asciidoc [DOCS] Support for nested functions in ES|QL STATS...BY (#104788) 2024-01-30 19:29:12 +01:00
predicates.asciidoc [DOCS] Examples for ES|QL DISSECT and WHERE (#102591) 2023-11-27 10:56:48 +01:00
README.md ESQL: Generate kibana inline docs (#106782) 2024-04-09 14:19:48 -04:00
rlike.asciidoc [ES|QL] Add/Modify annotations for operators for better doc generation (#108220) 2024-05-03 22:59:51 -04:00
round.asciidoc ESQL: Generate more docs (#106367) 2024-03-19 15:40:13 -04:00
spatial-functions.asciidoc [ES|QL] Add/Modify annotations for spatial and conditional functions for better doc generation (#107722) 2024-05-10 14:49:25 -04:00
st_centroid_agg.asciidoc Rename ST_CENTROID to ST_CENTROID_AGG (#107226) 2024-04-10 17:56:45 +02:00
string-functions.asciidoc [ES|QL] Add/Modify annotations for operators for better doc generation (#108220) 2024-05-03 22:59:51 -04:00
sum.asciidoc [DOCS] Support for nested functions in ES|QL STATS...BY (#104788) 2024-01-30 19:29:12 +01:00
type-conversion-functions.asciidoc [DOCS] ES|QL implicit casting (#108618) 2024-05-15 09:07:09 -04:00
unary.asciidoc ESQL: Add type tables for operators to docs (#103206) 2023-12-11 10:51:38 -05:00
values.asciidoc ESQL: Enable VALUES agg for datetime (#107016) 2024-04-03 07:42:40 -04:00

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 function
  • types - a table of each combination of support type for each parameter. These are generated from tests.
  • layout - a fully generated description for each function
  • kibana/definition - function definitions for kibana's ESQL editor
  • kibana/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