mv_first.asciidoc 1021 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. [discrete]
  2. [[esql-mv_first]]
  3. === `MV_FIRST`
  4. *Syntax*
  5. [.text-center]
  6. image::esql/functions/signature/mv_first.svg[Embedded,opts=inline]
  7. *Parameters*
  8. `v`::
  9. Multivalue expression.
  10. *Description*
  11. Converts a multivalued expression into a single valued column containing the
  12. first value. This is most useful when reading from a function that emits
  13. multivalued 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 minimum value use <<esql-mv_min>> instead of
  17. `MV_FIRST`. `MV_MIN` has optimizations for sorted values so there isn't a
  18. performance benefit to `MV_FIRST`.
  19. *Supported types*
  20. include::types/mv_first.asciidoc[]
  21. *Example*
  22. [source.merge.styled,esql]
  23. ----
  24. include::{esql-specs}/string.csv-spec[tag=mv_first]
  25. ----
  26. [%header.monospaced.styled,format=dsv,separator=|]
  27. |===
  28. include::{esql-specs}/string.csv-spec[tag=mv_first-result]
  29. |===