mv_slice.asciidoc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. [discrete]
  2. [[esql-mv_slice]]
  3. === `MV_SLICE`
  4. *Syntax*
  5. [.text-center]
  6. image::esql/functions/signature/mv_slice.svg[Embedded,opts=inline]
  7. *Parameters*
  8. `field`::
  9. Multivalue expression. If `null`, the function returns `null`.
  10. `start`::
  11. Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list.
  12. `end`::
  13. End position. Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list.
  14. *Description*
  15. Returns a subset of the multivalued field using the start and end index values.
  16. include::types/mv_slice.asciidoc[]
  17. *Example*
  18. [source.merge.styled,esql]
  19. ----
  20. include::{esql-specs}/ints.csv-spec[tag=mv_slice_positive]
  21. ----
  22. [%header.monospaced.styled,format=dsv,separator=|]
  23. |===
  24. include::{esql-specs}/ints.csv-spec[tag=mv_slice_positive-result]
  25. |===
  26. [source.merge.styled,esql]
  27. ----
  28. include::{esql-specs}/ints.csv-spec[tag=mv_slice_negative]
  29. ----
  30. [%header.monospaced.styled,format=dsv,separator=|]
  31. |===
  32. include::{esql-specs}/ints.csv-spec[tag=mv_slice_negative-result]
  33. |===