eval.asciidoc 761 B

123456789101112131415161718192021222324252627282930
  1. [discrete]
  2. [[esql-eval]]
  3. === `EVAL`
  4. `EVAL` enables you to append new columns:
  5. [source.merge.styled,esql]
  6. ----
  7. include::{esql-specs}/docs.csv-spec[tag=eval]
  8. ----
  9. [%header.monospaced.styled,format=dsv,separator=|]
  10. |===
  11. include::{esql-specs}/docs.csv-spec[tag=eval-result]
  12. |===
  13. If the specified column already exists, the existing column will be dropped, and
  14. the new column will be appended to the table:
  15. [source.merge.styled,esql]
  16. ----
  17. include::{esql-specs}/docs.csv-spec[tag=evalReplace]
  18. ----
  19. [%header.monospaced.styled,format=dsv,separator=|]
  20. |===
  21. include::{esql-specs}/docs.csv-spec[tag=evalReplace-result]
  22. |===
  23. [discrete]
  24. ==== Functions
  25. `EVAL` supports various functions for calculating values. Refer to
  26. <<esql-functions,Functions>> for more information.