elasticsearch/docs/reference/esql/functions/description/mv_last.asciidoc
Nik Everett ebe3c0f10d
ESQL: Document MV_SLICE limitations (#114162)
`MV_SLICE` is useful, but loading values from lucene frequently sorts
them so `MV_SLICE` is not as useful as you think it is. It's mostly for
after, say, a `SPLIT`. This documents that and adds a link to the
section on multivalues.

It also moves similar docs to a separate paragraph in the docs for
easier reading.
2024-10-09 05:04:36 +11:00

11 lines
675 B
Text
Generated

// This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
*Description*
Converts a multivalue expression into a single valued column containing the last value. This is most useful when reading from a function that emits multivalued columns in a known order like <<esql-split>>.
The order that <<esql-multivalued-fields, multivalued fields>> are read from
underlying storage is not guaranteed. It is *frequently* ascending, but don't
rely on that. If you need the maximum value use <<esql-mv_max>> instead of
`MV_LAST`. `MV_MAX` has optimizations for sorted values so there isn't a
performance benefit to `MV_LAST`.