values.asciidoc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. [discrete]
  2. [[esql-agg-values]]
  3. === `VALUES`
  4. preview::["Do not use `VALUES` on production environments. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features."]
  5. *Syntax*
  6. [source,esql]
  7. ----
  8. VALUES(expression)
  9. ----
  10. `expression`::
  11. Expression of any type except `geo_point`, `cartesian_point`, or `geo_shape`.
  12. *Description*
  13. Returns all values in a group as a multivalued field. The order of the returned values isn't guaranteed.
  14. If you need the values returned in order use <<esql-mv_sort>>.
  15. WARNING: This can use a significant amount of memory and ES|QL doesn't yet
  16. grow aggregations beyond memory. So this aggregation will work until
  17. it is used to collect more values than can fit into memory. Once it
  18. collects too many values it will fail the query with
  19. a <<circuit-breaker-errors, Circuit Breaker Error>>.
  20. *Example*
  21. [source.merge.styled,esql]
  22. ----
  23. include::{esql-specs}/string.csv-spec[tag=values-grouped]
  24. ----
  25. [%header.monospaced.styled,format=dsv,separator=|]
  26. |===
  27. include::{esql-specs}/string.csv-spec[tag=values-grouped-result]
  28. |===