Browse Source

Docs for `mv_min` (ESQL-1092)

This adds docs for the `mv_min` function. It uses an as yet unsupported
syntax, `ROW a=[2,1]`, but I think we'll support it before long.
Nik Everett 2 years ago
parent
commit
ce1d634d77

+ 3 - 0
docs/reference/esql/esql-functions.asciidoc

@@ -15,6 +15,7 @@ these functions:
 * <<esql-is_nan>>
 * <<esql-is_null>>
 * <<esql-length>>
+* <<esql-mv_min>>
 * <<esql-pow>>
 * <<esql-round>>
 * <<esql-split>>
@@ -161,6 +162,8 @@ FROM employees
 | EVAL fn_length = LENGTH(first_name)
 ----
 
+include::functions/mv_min.asciidoc[]
+
 [[esql-pow]]
 === `POW`
 Returns the the value of a base (first argument) raised to a power (second

+ 18 - 0
docs/reference/esql/functions/mv_min.asciidoc

@@ -0,0 +1,18 @@
+[[esql-mv_min]]
+=== `MV_MIN`
+Converts a multivalued field into a single valued field containing the minimum value. For example:
+
+[source,esql]
+----
+include::{esql-specs}/math.csv-spec[tag=mv_min]
+include::{esql-specs}/math.csv-spec[tag=mv_min-result]
+----
+
+It can be used by any field type, including `keyword` fields. In that case picks the
+first string, comparing their utf-8 representation byte by byte:
+
+[source,esql]
+----
+include::{esql-specs}/string.csv-spec[tag=mv_min]
+include::{esql-specs}/string.csv-spec[tag=mv_min-result]
+----