mv_last.asciidoc 992 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. [discrete]
  2. [[esql-mv_last]]
  3. === `MV_LAST`
  4. *Syntax*
  5. [.text-center]
  6. image::esql/functions/signature/mv_last.svg[Embedded,opts=inline]
  7. *Parameters*
  8. `v`::
  9. Multivalue expression.
  10. *Description*
  11. Converts a multivalue expression into a single valued column containing the last
  12. value. This is most useful when reading from a function that emits multivalued
  13. columns in a known order like <<esql-split>>.
  14. The order that <<esql-multivalued-fields, multivalued fields>> are read from
  15. underlying storage is not guaranteed. It is *frequently* ascending, but don't
  16. rely on that. If you need the maximum value use <<esql-mv_max>> instead of
  17. `MV_LAST`. `MV_MAX` has optimizations for sorted values so there isn't a
  18. performance benefit to `MV_LAST`.
  19. include::types/mv_last.asciidoc[]
  20. *Example*
  21. [source.merge.styled,esql]
  22. ----
  23. include::{esql-specs}/string.csv-spec[tag=mv_last]
  24. ----
  25. [%header.monospaced.styled,format=dsv,separator=|]
  26. |===
  27. include::{esql-specs}/string.csv-spec[tag=mv_last-result]
  28. |===