Browse Source

[ES|QL] Annotate all ESQL functions (for SHOW FUNCTIONS) (#103686)

* :wrench: Initial annotations

* :pencil2: Add substring doc

* :label: Fix imports

* :pencil2: Add annotations for string fns

* :recycle: Fix issues

* :rotatin_light: Fix linting issues

* :pencil2: Add more annotations

* :rotatin_light: Fix linting issues

* :recycle: Add missing import

* :pencil2: Add more annotations

* :rotating_light: Fix linting

* :white_check_mark: Fix many tests for new annotations

* :white_check_mark: Fix more tests

* :bug: Fix missing flag

* :sparkles: Annotate new functions

* :white_check_mark: fix more tests

* :white_check_mark: Fix signature issue

* :white_check_mark: Make all csv tests pass

* :white_check_mark: Fix remaining tests

* :sparkles: New assets from annotations

* :white_check_mark: Refactor test

* :white_check_mark: Fix updated signature
Marco Liberati 1 year ago
parent
commit
3145e9f9fc
100 changed files with 611 additions and 301 deletions
  1. 1 1
      docs/reference/esql/functions/signature/coalesce.svg
  2. 1 1
      docs/reference/esql/functions/signature/concat.svg
  3. 1 1
      docs/reference/esql/functions/signature/date_extract.svg
  4. 1 1
      docs/reference/esql/functions/signature/ends_with.svg
  5. 1 1
      docs/reference/esql/functions/signature/left.svg
  6. 1 1
      docs/reference/esql/functions/signature/length.svg
  7. 1 1
      docs/reference/esql/functions/signature/mv_avg.svg
  8. 1 1
      docs/reference/esql/functions/signature/mv_median.svg
  9. 1 1
      docs/reference/esql/functions/signature/mv_sum.svg
  10. 1 1
      docs/reference/esql/functions/signature/replace.svg
  11. 1 1
      docs/reference/esql/functions/signature/right.svg
  12. 1 1
      docs/reference/esql/functions/signature/round.svg
  13. 1 1
      docs/reference/esql/functions/signature/split.svg
  14. 1 1
      docs/reference/esql/functions/signature/starts_with.svg
  15. 1 1
      docs/reference/esql/functions/signature/substring.svg
  16. 1 1
      docs/reference/esql/functions/types/case.asciidoc
  17. 1 1
      docs/reference/esql/functions/types/coalesce.asciidoc
  18. 1 1
      docs/reference/esql/functions/types/concat.asciidoc
  19. 1 1
      docs/reference/esql/functions/types/date_extract.asciidoc
  20. 2 1
      docs/reference/esql/functions/types/ends_with.asciidoc
  21. 0 5
      docs/reference/esql/functions/types/is_finite.asciidoc
  22. 0 5
      docs/reference/esql/functions/types/is_infinite.asciidoc
  23. 0 5
      docs/reference/esql/functions/types/is_nan.asciidoc
  24. 2 1
      docs/reference/esql/functions/types/left.asciidoc
  25. 2 1
      docs/reference/esql/functions/types/length.asciidoc
  26. 1 1
      docs/reference/esql/functions/types/mv_avg.asciidoc
  27. 1 1
      docs/reference/esql/functions/types/mv_median.asciidoc
  28. 1 1
      docs/reference/esql/functions/types/mv_sum.asciidoc
  29. 1 1
      docs/reference/esql/functions/types/replace.asciidoc
  30. 2 1
      docs/reference/esql/functions/types/right.asciidoc
  31. 1 1
      docs/reference/esql/functions/types/round.asciidoc
  32. 2 1
      docs/reference/esql/functions/types/split.asciidoc
  33. 2 1
      docs/reference/esql/functions/types/starts_with.asciidoc
  34. 2 1
      docs/reference/esql/functions/types/substring.asciidoc
  35. 148 148
      x-pack/plugin/esql/qa/testFixtures/src/main/resources/show.csv-spec
  36. 2 1
      x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/EsqlActionIT.java
  37. 13 5
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java
  38. 2 0
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/FunctionInfo.java
  39. 4 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Avg.java
  40. 24 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Count.java
  41. 24 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/CountDistinct.java
  42. 8 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Max.java
  43. 8 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Median.java
  44. 11 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/MedianAbsoluteDeviation.java
  45. 8 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Min.java
  46. 12 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Percentile.java
  47. 4 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Sum.java
  48. 40 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Case.java
  49. 5 0
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Greatest.java
  50. 5 0
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Least.java
  51. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToBoolean.java
  52. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToCartesianPoint.java
  53. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDatetime.java
  54. 2 2
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDegrees.java
  55. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDouble.java
  56. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToGeoPoint.java
  57. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToIP.java
  58. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToInteger.java
  59. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToLong.java
  60. 2 2
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToRadians.java
  61. 8 8
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToString.java
  62. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToUnsignedLong.java
  63. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToVersion.java
  64. 17 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtract.java
  65. 12 4
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormat.java
  66. 14 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateTrunc.java
  67. 2 0
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/Now.java
  68. 8 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/ip/CIDRMatch.java
  69. 2 2
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Abs.java
  70. 2 2
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Acos.java
  71. 2 2
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Asin.java
  72. 2 2
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan.java
  73. 6 3
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan2.java
  74. 3 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucket.java
  75. 3 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Ceil.java
  76. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cos.java
  77. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cosh.java
  78. 2 0
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/E.java
  79. 6 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Floor.java
  80. 3 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10.java
  81. 3 0
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Pi.java
  82. 4 2
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Pow.java
  83. 14 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Round.java
  84. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sin.java
  85. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sinh.java
  86. 3 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sqrt.java
  87. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tan.java
  88. 1 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tanh.java
  89. 2 0
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tau.java
  90. 7 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvg.java
  91. 7 7
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvCount.java
  92. 6 5
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvDedupe.java
  93. 23 8
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvFirst.java
  94. 23 8
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvLast.java
  95. 5 2
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMax.java
  96. 7 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedian.java
  97. 5 2
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMin.java
  98. 7 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSum.java
  99. 19 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/Coalesce.java
  100. 8 1
      x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Concat.java

+ 1 - 1
docs/reference/esql/functions/signature/coalesce.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="408" height="46" viewbox="0 0 408 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m116 0h10m32 0h10m68 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="116" height="36"/><text class="k" x="15" y="31">COALESCE</text><rect class="s" x="131" y="5" width="32" height="36" rx="7"/><text class="syn" x="141" y="31">(</text><rect class="s" x="173" y="5" width="68" height="36" rx="7"/><text class="k" x="183" y="31">arg1</text><rect class="s" x="251" y="5" width="32" height="36" rx="7"/><text class="syn" x="261" y="31">,</text><rect class="s" x="293" y="5" width="68" height="36" rx="7"/><text class="k" x="303" y="31">arg2</text><rect class="s" x="371" y="5" width="32" height="36" rx="7"/><text class="syn" x="381" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="564" height="46" viewbox="0 0 564 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m116 0h10m32 0h10m140 0h10m32 0h10m152 0h10m32 0h5"/><rect class="s" x="5" y="5" width="116" height="36"/><text class="k" x="15" y="31">COALESCE</text><rect class="s" x="131" y="5" width="32" height="36" rx="7"/><text class="syn" x="141" y="31">(</text><rect class="s" x="173" y="5" width="140" height="36" rx="7"/><text class="k" x="183" y="31">expression</text><rect class="s" x="323" y="5" width="32" height="36" rx="7"/><text class="syn" x="333" y="31">,</text><rect class="s" x="365" y="5" width="152" height="36" rx="7"/><text class="k" x="375" y="31">expressionX</text><rect class="s" x="527" y="5" width="32" height="36" rx="7"/><text class="syn" x="537" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/concat.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="384" height="46" viewbox="0 0 384 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m92 0h10m32 0h10m68 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="92" height="36"/><text class="k" x="15" y="31">CONCAT</text><rect class="s" x="107" y="5" width="32" height="36" rx="7"/><text class="syn" x="117" y="31">(</text><rect class="s" x="149" y="5" width="68" height="36" rx="7"/><text class="k" x="159" y="31">arg1</text><rect class="s" x="227" y="5" width="32" height="36" rx="7"/><text class="syn" x="237" y="31">,</text><rect class="s" x="269" y="5" width="68" height="36" rx="7"/><text class="k" x="279" y="31">arg2</text><rect class="s" x="347" y="5" width="32" height="36" rx="7"/><text class="syn" x="357" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="396" height="46" viewbox="0 0 396 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m92 0h10m32 0h10m80 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="92" height="36"/><text class="k" x="15" y="31">CONCAT</text><rect class="s" x="107" y="5" width="32" height="36" rx="7"/><text class="syn" x="117" y="31">(</text><rect class="s" x="149" y="5" width="80" height="36" rx="7"/><text class="k" x="159" y="31">first</text><rect class="s" x="239" y="5" width="32" height="36" rx="7"/><text class="syn" x="249" y="31">,</text><rect class="s" x="281" y="5" width="68" height="36" rx="7"/><text class="k" x="291" y="31">rest</text><rect class="s" x="359" y="5" width="32" height="36" rx="7"/><text class="syn" x="369" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/date_extract.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="456" height="46" viewbox="0 0 456 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m164 0h10m32 0h10m68 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="164" height="36"/><text class="k" x="15" y="31">DATE_EXTRACT</text><rect class="s" x="179" y="5" width="32" height="36" rx="7"/><text class="syn" x="189" y="31">(</text><rect class="s" x="221" y="5" width="68" height="36" rx="7"/><text class="k" x="231" y="31">arg1</text><rect class="s" x="299" y="5" width="32" height="36" rx="7"/><text class="syn" x="309" y="31">,</text><rect class="s" x="341" y="5" width="68" height="36" rx="7"/><text class="k" x="351" y="31">arg2</text><rect class="s" x="419" y="5" width="32" height="36" rx="7"/><text class="syn" x="429" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="528" height="46" viewbox="0 0 528 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m164 0h10m32 0h10m128 0h10m32 0h10m80 0h10m32 0h5"/><rect class="s" x="5" y="5" width="164" height="36"/><text class="k" x="15" y="31">DATE_EXTRACT</text><rect class="s" x="179" y="5" width="32" height="36" rx="7"/><text class="syn" x="189" y="31">(</text><rect class="s" x="221" y="5" width="128" height="36" rx="7"/><text class="k" x="231" y="31">date_part</text><rect class="s" x="359" y="5" width="32" height="36" rx="7"/><text class="syn" x="369" y="31">,</text><rect class="s" x="401" y="5" width="80" height="36" rx="7"/><text class="k" x="411" y="31">field</text><rect class="s" x="491" y="5" width="32" height="36" rx="7"/><text class="syn" x="501" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/ends_with.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="420" height="46" viewbox="0 0 420 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m128 0h10m32 0h10m68 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="128" height="36"/><text class="k" x="15" y="31">ENDS_WITH</text><rect class="s" x="143" y="5" width="32" height="36" rx="7"/><text class="syn" x="153" y="31">(</text><rect class="s" x="185" y="5" width="68" height="36" rx="7"/><text class="k" x="195" y="31">arg1</text><rect class="s" x="263" y="5" width="32" height="36" rx="7"/><text class="syn" x="273" y="31">,</text><rect class="s" x="305" y="5" width="68" height="36" rx="7"/><text class="k" x="315" y="31">arg2</text><rect class="s" x="383" y="5" width="32" height="36" rx="7"/><text class="syn" x="393" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="432" height="46" viewbox="0 0 432 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m128 0h10m32 0h10m56 0h10m32 0h10m92 0h10m32 0h5"/><rect class="s" x="5" y="5" width="128" height="36"/><text class="k" x="15" y="31">ENDS_WITH</text><rect class="s" x="143" y="5" width="32" height="36" rx="7"/><text class="syn" x="153" y="31">(</text><rect class="s" x="185" y="5" width="56" height="36" rx="7"/><text class="k" x="195" y="31">str</text><rect class="s" x="251" y="5" width="32" height="36" rx="7"/><text class="syn" x="261" y="31">,</text><rect class="s" x="293" y="5" width="92" height="36" rx="7"/><text class="k" x="303" y="31">suffix</text><rect class="s" x="395" y="5" width="32" height="36" rx="7"/><text class="syn" x="405" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/left.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="408" height="46" viewbox="0 0 408 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m68 0h10m32 0h10m92 0h10m32 0h10m92 0h10m32 0h5"/><rect class="s" x="5" y="5" width="68" height="36"/><text class="k" x="15" y="31">LEFT</text><rect class="s" x="83" y="5" width="32" height="36" rx="7"/><text class="syn" x="93" y="31">(</text><rect class="s" x="125" y="5" width="92" height="36" rx="7"/><text class="k" x="135" y="31">string</text><rect class="s" x="227" y="5" width="32" height="36" rx="7"/><text class="syn" x="237" y="31">,</text><rect class="s" x="269" y="5" width="92" height="36" rx="7"/><text class="k" x="279" y="31">length</text><rect class="s" x="371" y="5" width="32" height="36" rx="7"/><text class="syn" x="381" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="372" height="46" viewbox="0 0 372 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m68 0h10m32 0h10m56 0h10m32 0h10m92 0h10m32 0h5"/><rect class="s" x="5" y="5" width="68" height="36"/><text class="k" x="15" y="31">LEFT</text><rect class="s" x="83" y="5" width="32" height="36" rx="7"/><text class="syn" x="93" y="31">(</text><rect class="s" x="125" y="5" width="56" height="36" rx="7"/><text class="k" x="135" y="31">str</text><rect class="s" x="191" y="5" width="32" height="36" rx="7"/><text class="syn" x="201" y="31">,</text><rect class="s" x="233" y="5" width="92" height="36" rx="7"/><text class="k" x="243" y="31">length</text><rect class="s" x="335" y="5" width="32" height="36" rx="7"/><text class="syn" x="345" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/length.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="264" height="46" viewbox="0 0 264 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m92 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="92" height="36"/><text class="k" x="15" y="31">LENGTH</text><rect class="s" x="107" y="5" width="32" height="36" rx="7"/><text class="syn" x="117" y="31">(</text><rect class="s" x="149" y="5" width="68" height="36" rx="7"/><text class="k" x="159" y="31">arg1</text><rect class="s" x="227" y="5" width="32" height="36" rx="7"/><text class="syn" x="237" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="252" height="46" viewbox="0 0 252 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m92 0h10m32 0h10m56 0h10m32 0h5"/><rect class="s" x="5" y="5" width="92" height="36"/><text class="k" x="15" y="31">LENGTH</text><rect class="s" x="107" y="5" width="32" height="36" rx="7"/><text class="syn" x="117" y="31">(</text><rect class="s" x="149" y="5" width="56" height="36" rx="7"/><text class="k" x="159" y="31">str</text><rect class="s" x="215" y="5" width="32" height="36" rx="7"/><text class="syn" x="225" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/mv_avg.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="264" height="46" viewbox="0 0 264 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m92 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="92" height="36"/><text class="k" x="15" y="31">MV_AVG</text><rect class="s" x="107" y="5" width="32" height="36" rx="7"/><text class="syn" x="117" y="31">(</text><rect class="s" x="149" y="5" width="68" height="36" rx="7"/><text class="k" x="159" y="31">arg1</text><rect class="s" x="227" y="5" width="32" height="36" rx="7"/><text class="syn" x="237" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="276" height="46" viewbox="0 0 276 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m92 0h10m32 0h10m80 0h10m32 0h5"/><rect class="s" x="5" y="5" width="92" height="36"/><text class="k" x="15" y="31">MV_AVG</text><rect class="s" x="107" y="5" width="32" height="36" rx="7"/><text class="syn" x="117" y="31">(</text><rect class="s" x="149" y="5" width="80" height="36" rx="7"/><text class="k" x="159" y="31">field</text><rect class="s" x="239" y="5" width="32" height="36" rx="7"/><text class="syn" x="249" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/mv_median.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="300" height="46" viewbox="0 0 300 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m128 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="128" height="36"/><text class="k" x="15" y="31">MV_MEDIAN</text><rect class="s" x="143" y="5" width="32" height="36" rx="7"/><text class="syn" x="153" y="31">(</text><rect class="s" x="185" y="5" width="68" height="36" rx="7"/><text class="k" x="195" y="31">arg1</text><rect class="s" x="263" y="5" width="32" height="36" rx="7"/><text class="syn" x="273" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="264" height="46" viewbox="0 0 264 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m128 0h10m32 0h10m32 0h10m32 0h5"/><rect class="s" x="5" y="5" width="128" height="36"/><text class="k" x="15" y="31">MV_MEDIAN</text><rect class="s" x="143" y="5" width="32" height="36" rx="7"/><text class="syn" x="153" y="31">(</text><rect class="s" x="185" y="5" width="32" height="36" rx="7"/><text class="k" x="195" y="31">v</text><rect class="s" x="227" y="5" width="32" height="36" rx="7"/><text class="syn" x="237" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/mv_sum.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="264" height="46" viewbox="0 0 264 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m92 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="92" height="36"/><text class="k" x="15" y="31">MV_SUM</text><rect class="s" x="107" y="5" width="32" height="36" rx="7"/><text class="syn" x="117" y="31">(</text><rect class="s" x="149" y="5" width="68" height="36" rx="7"/><text class="k" x="159" y="31">arg1</text><rect class="s" x="227" y="5" width="32" height="36" rx="7"/><text class="syn" x="237" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="228" height="46" viewbox="0 0 228 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m92 0h10m32 0h10m32 0h10m32 0h5"/><rect class="s" x="5" y="5" width="92" height="36"/><text class="k" x="15" y="31">MV_SUM</text><rect class="s" x="107" y="5" width="32" height="36" rx="7"/><text class="syn" x="117" y="31">(</text><rect class="s" x="149" y="5" width="32" height="36" rx="7"/><text class="k" x="159" y="31">v</text><rect class="s" x="191" y="5" width="32" height="36" rx="7"/><text class="syn" x="201" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/replace.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="516" height="46" viewbox="0 0 516 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m104 0h10m32 0h10m68 0h10m32 0h10m68 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="104" height="36"/><text class="k" x="15" y="31">REPLACE</text><rect class="s" x="119" y="5" width="32" height="36" rx="7"/><text class="syn" x="129" y="31">(</text><rect class="s" x="161" y="5" width="68" height="36" rx="7"/><text class="k" x="171" y="31">arg1</text><rect class="s" x="239" y="5" width="32" height="36" rx="7"/><text class="syn" x="249" y="31">,</text><rect class="s" x="281" y="5" width="68" height="36" rx="7"/><text class="k" x="291" y="31">arg2</text><rect class="s" x="359" y="5" width="32" height="36" rx="7"/><text class="syn" x="369" y="31">,</text><rect class="s" x="401" y="5" width="68" height="36" rx="7"/><text class="k" x="411" y="31">arg3</text><rect class="s" x="479" y="5" width="32" height="36" rx="7"/><text class="syn" x="489" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="540" height="46" viewbox="0 0 540 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m104 0h10m32 0h10m56 0h10m32 0h10m80 0h10m32 0h10m92 0h10m32 0h5"/><rect class="s" x="5" y="5" width="104" height="36"/><text class="k" x="15" y="31">REPLACE</text><rect class="s" x="119" y="5" width="32" height="36" rx="7"/><text class="syn" x="129" y="31">(</text><rect class="s" x="161" y="5" width="56" height="36" rx="7"/><text class="k" x="171" y="31">str</text><rect class="s" x="227" y="5" width="32" height="36" rx="7"/><text class="syn" x="237" y="31">,</text><rect class="s" x="269" y="5" width="80" height="36" rx="7"/><text class="k" x="279" y="31">regex</text><rect class="s" x="359" y="5" width="32" height="36" rx="7"/><text class="syn" x="369" y="31">,</text><rect class="s" x="401" y="5" width="92" height="36" rx="7"/><text class="k" x="411" y="31">newStr</text><rect class="s" x="503" y="5" width="32" height="36" rx="7"/><text class="syn" x="513" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/right.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="420" height="46" viewbox="0 0 420 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m80 0h10m32 0h10m92 0h10m32 0h10m92 0h10m32 0h5"/><rect class="s" x="5" y="5" width="80" height="36"/><text class="k" x="15" y="31">RIGHT</text><rect class="s" x="95" y="5" width="32" height="36" rx="7"/><text class="syn" x="105" y="31">(</text><rect class="s" x="137" y="5" width="92" height="36" rx="7"/><text class="k" x="147" y="31">string</text><rect class="s" x="239" y="5" width="32" height="36" rx="7"/><text class="syn" x="249" y="31">,</text><rect class="s" x="281" y="5" width="92" height="36" rx="7"/><text class="k" x="291" y="31">length</text><rect class="s" x="383" y="5" width="32" height="36" rx="7"/><text class="syn" x="393" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="384" height="46" viewbox="0 0 384 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m80 0h10m32 0h10m56 0h10m32 0h10m92 0h10m32 0h5"/><rect class="s" x="5" y="5" width="80" height="36"/><text class="k" x="15" y="31">RIGHT</text><rect class="s" x="95" y="5" width="32" height="36" rx="7"/><text class="syn" x="105" y="31">(</text><rect class="s" x="137" y="5" width="56" height="36" rx="7"/><text class="k" x="147" y="31">str</text><rect class="s" x="203" y="5" width="32" height="36" rx="7"/><text class="syn" x="213" y="31">,</text><rect class="s" x="245" y="5" width="92" height="36" rx="7"/><text class="k" x="255" y="31">length</text><rect class="s" x="347" y="5" width="32" height="36" rx="7"/><text class="syn" x="357" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/round.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="372" height="46" viewbox="0 0 372 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m80 0h10m32 0h10m68 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="80" height="36"/><text class="k" x="15" y="31">ROUND</text><rect class="s" x="95" y="5" width="32" height="36" rx="7"/><text class="syn" x="105" y="31">(</text><rect class="s" x="137" y="5" width="68" height="36" rx="7"/><text class="k" x="147" y="31">arg1</text><rect class="s" x="215" y="5" width="32" height="36" rx="7"/><text class="syn" x="225" y="31">,</text><rect class="s" x="257" y="5" width="68" height="36" rx="7"/><text class="k" x="267" y="31">arg2</text><rect class="s" x="335" y="5" width="32" height="36" rx="7"/><text class="syn" x="345" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="432" height="46" viewbox="0 0 432 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m80 0h10m32 0h10m80 0h10m32 0h10m116 0h10m32 0h5"/><rect class="s" x="5" y="5" width="80" height="36"/><text class="k" x="15" y="31">ROUND</text><rect class="s" x="95" y="5" width="32" height="36" rx="7"/><text class="syn" x="105" y="31">(</text><rect class="s" x="137" y="5" width="80" height="36" rx="7"/><text class="k" x="147" y="31">value</text><rect class="s" x="227" y="5" width="32" height="36" rx="7"/><text class="syn" x="237" y="31">,</text><rect class="s" x="269" y="5" width="116" height="36" rx="7"/><text class="k" x="279" y="31">decimals</text><rect class="s" x="395" y="5" width="32" height="36" rx="7"/><text class="syn" x="405" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/split.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="372" height="46" viewbox="0 0 372 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m80 0h10m32 0h10m68 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="80" height="36"/><text class="k" x="15" y="31">SPLIT</text><rect class="s" x="95" y="5" width="32" height="36" rx="7"/><text class="syn" x="105" y="31">(</text><rect class="s" x="137" y="5" width="68" height="36" rx="7"/><text class="k" x="147" y="31">arg1</text><rect class="s" x="215" y="5" width="32" height="36" rx="7"/><text class="syn" x="225" y="31">,</text><rect class="s" x="257" y="5" width="68" height="36" rx="7"/><text class="k" x="267" y="31">arg2</text><rect class="s" x="335" y="5" width="32" height="36" rx="7"/><text class="syn" x="345" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="372" height="46" viewbox="0 0 372 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m80 0h10m32 0h10m56 0h10m32 0h10m80 0h10m32 0h5"/><rect class="s" x="5" y="5" width="80" height="36"/><text class="k" x="15" y="31">SPLIT</text><rect class="s" x="95" y="5" width="32" height="36" rx="7"/><text class="syn" x="105" y="31">(</text><rect class="s" x="137" y="5" width="56" height="36" rx="7"/><text class="k" x="147" y="31">str</text><rect class="s" x="203" y="5" width="32" height="36" rx="7"/><text class="syn" x="213" y="31">,</text><rect class="s" x="245" y="5" width="80" height="36" rx="7"/><text class="k" x="255" y="31">delim</text><rect class="s" x="335" y="5" width="32" height="36" rx="7"/><text class="syn" x="345" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/starts_with.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="444" height="46" viewbox="0 0 444 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m152 0h10m32 0h10m68 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="152" height="36"/><text class="k" x="15" y="31">STARTS_WITH</text><rect class="s" x="167" y="5" width="32" height="36" rx="7"/><text class="syn" x="177" y="31">(</text><rect class="s" x="209" y="5" width="68" height="36" rx="7"/><text class="k" x="219" y="31">arg1</text><rect class="s" x="287" y="5" width="32" height="36" rx="7"/><text class="syn" x="297" y="31">,</text><rect class="s" x="329" y="5" width="68" height="36" rx="7"/><text class="k" x="339" y="31">arg2</text><rect class="s" x="407" y="5" width="32" height="36" rx="7"/><text class="syn" x="417" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="456" height="46" viewbox="0 0 456 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m152 0h10m32 0h10m56 0h10m32 0h10m92 0h10m32 0h5"/><rect class="s" x="5" y="5" width="152" height="36"/><text class="k" x="15" y="31">STARTS_WITH</text><rect class="s" x="167" y="5" width="32" height="36" rx="7"/><text class="syn" x="177" y="31">(</text><rect class="s" x="209" y="5" width="56" height="36" rx="7"/><text class="k" x="219" y="31">str</text><rect class="s" x="275" y="5" width="32" height="36" rx="7"/><text class="syn" x="285" y="31">,</text><rect class="s" x="317" y="5" width="92" height="36" rx="7"/><text class="k" x="327" y="31">prefix</text><rect class="s" x="419" y="5" width="32" height="36" rx="7"/><text class="syn" x="429" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/signature/substring.svg

@@ -1 +1 @@
-<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="540" height="46" viewbox="0 0 540 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m128 0h10m32 0h10m68 0h10m32 0h10m68 0h10m32 0h10m68 0h10m32 0h5"/><rect class="s" x="5" y="5" width="128" height="36"/><text class="k" x="15" y="31">SUBSTRING</text><rect class="s" x="143" y="5" width="32" height="36" rx="7"/><text class="syn" x="153" y="31">(</text><rect class="s" x="185" y="5" width="68" height="36" rx="7"/><text class="k" x="195" y="31">arg1</text><rect class="s" x="263" y="5" width="32" height="36" rx="7"/><text class="syn" x="273" y="31">,</text><rect class="s" x="305" y="5" width="68" height="36" rx="7"/><text class="k" x="315" y="31">arg2</text><rect class="s" x="383" y="5" width="32" height="36" rx="7"/><text class="syn" x="393" y="31">,</text><rect class="s" x="425" y="5" width="68" height="36" rx="7"/><text class="k" x="435" y="31">arg3</text><rect class="s" x="503" y="5" width="32" height="36" rx="7"/><text class="syn" x="513" y="31">)</text></svg>
+<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="564" height="46" viewbox="0 0 564 46"><defs><style type="text/css">#guide .c{fill:none;stroke:#222222;}#guide .k{fill:#000000;font-family:Roboto Mono,Sans-serif;font-size:20px;}#guide .s{fill:#e4f4ff;stroke:#222222;}#guide .syn{fill:#8D8D8D;font-family:Roboto Mono,Sans-serif;font-size:20px;}</style></defs><path class="c" d="M0 31h5m128 0h10m32 0h10m56 0h10m32 0h10m80 0h10m32 0h10m92 0h10m32 0h5"/><rect class="s" x="5" y="5" width="128" height="36"/><text class="k" x="15" y="31">SUBSTRING</text><rect class="s" x="143" y="5" width="32" height="36" rx="7"/><text class="syn" x="153" y="31">(</text><rect class="s" x="185" y="5" width="56" height="36" rx="7"/><text class="k" x="195" y="31">str</text><rect class="s" x="251" y="5" width="32" height="36" rx="7"/><text class="syn" x="261" y="31">,</text><rect class="s" x="293" y="5" width="80" height="36" rx="7"/><text class="k" x="303" y="31">start</text><rect class="s" x="383" y="5" width="32" height="36" rx="7"/><text class="syn" x="393" y="31">,</text><rect class="s" x="425" y="5" width="92" height="36" rx="7"/><text class="k" x="435" y="31">length</text><rect class="s" x="527" y="5" width="32" height="36" rx="7"/><text class="syn" x="537" y="31">)</text></svg>

+ 1 - 1
docs/reference/esql/functions/types/case.asciidoc

@@ -1,5 +1,5 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | arg2 | result
+condition | rest | result
 
 |===

+ 1 - 1
docs/reference/esql/functions/types/coalesce.asciidoc

@@ -1,6 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | arg2 | result
+expression | expressionX | result
 boolean | boolean | boolean
 integer | integer | integer
 keyword | keyword | keyword

+ 1 - 1
docs/reference/esql/functions/types/concat.asciidoc

@@ -1,6 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | arg2 | result
+first | rest | result
 keyword | keyword | keyword
 text | text | keyword
 |===

+ 1 - 1
docs/reference/esql/functions/types/date_extract.asciidoc

@@ -1,5 +1,5 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | arg2 | result
+date_part | field | result
 keyword | datetime | long
 |===

+ 2 - 1
docs/reference/esql/functions/types/ends_with.asciidoc

@@ -1,5 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | arg2 | result
+str | suffix | result
 keyword | keyword | boolean
+text | text | boolean
 |===

+ 0 - 5
docs/reference/esql/functions/types/is_finite.asciidoc

@@ -1,5 +0,0 @@
-[%header.monospaced.styled,format=dsv,separator=|]
-|===
-n | result
-double | boolean
-|===

+ 0 - 5
docs/reference/esql/functions/types/is_infinite.asciidoc

@@ -1,5 +0,0 @@
-[%header.monospaced.styled,format=dsv,separator=|]
-|===
-n | result
-double | boolean
-|===

+ 0 - 5
docs/reference/esql/functions/types/is_nan.asciidoc

@@ -1,5 +0,0 @@
-[%header.monospaced.styled,format=dsv,separator=|]
-|===
-n | result
-double | boolean
-|===

+ 2 - 1
docs/reference/esql/functions/types/left.asciidoc

@@ -1,5 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-string | length | result
+str | length | result
 keyword | integer | keyword
+text | integer | keyword
 |===

+ 2 - 1
docs/reference/esql/functions/types/length.asciidoc

@@ -1,5 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | result
+str | result
 keyword | integer
+text | integer
 |===

+ 1 - 1
docs/reference/esql/functions/types/mv_avg.asciidoc

@@ -1,6 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | result
+field | result
 double | double
 integer | double
 long | double

+ 1 - 1
docs/reference/esql/functions/types/mv_median.asciidoc

@@ -1,6 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | result
+v | result
 double | double
 integer | integer
 long | long

+ 1 - 1
docs/reference/esql/functions/types/mv_sum.asciidoc

@@ -1,6 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | result
+v | result
 double | double
 integer | integer
 long | long

+ 1 - 1
docs/reference/esql/functions/types/replace.asciidoc

@@ -1,6 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | arg2 | arg3 | result
+str | regex | newStr | result
 keyword | keyword | keyword | keyword
 keyword | keyword | text | keyword
 keyword | text | keyword | keyword

+ 2 - 1
docs/reference/esql/functions/types/right.asciidoc

@@ -1,5 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-string | length | result
+str | length | result
 keyword | integer | keyword
+text | integer | keyword
 |===

+ 1 - 1
docs/reference/esql/functions/types/round.asciidoc

@@ -1,5 +1,5 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | arg2 | result
+value | decimals | result
 double | integer | double
 |===

+ 2 - 1
docs/reference/esql/functions/types/split.asciidoc

@@ -1,5 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | arg2 | result
+str | delim | result
 keyword | keyword | keyword
+text | text | keyword
 |===

+ 2 - 1
docs/reference/esql/functions/types/starts_with.asciidoc

@@ -1,5 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | arg2 | result
+str | prefix | result
 keyword | keyword | boolean
+text | text | boolean
 |===

+ 2 - 1
docs/reference/esql/functions/types/substring.asciidoc

@@ -1,5 +1,6 @@
 [%header.monospaced.styled,format=dsv,separator=|]
 |===
-arg1 | arg2 | arg3 | result
+str | start | length | result
 keyword | integer | integer | keyword
+text | integer | integer | keyword
 |===

+ 148 - 148
x-pack/plugin/esql/qa/testFixtures/src/main/resources/show.csv-spec

@@ -9,91 +9,91 @@ v:long
 showFunctions#[skip:-8.12.99]
 show functions;
 
-       name:keyword      |                        synopsis:keyword          |       argNames:keyword  | argTypes:keyword |             argDescriptions:keyword                |returnType:keyword   |    description:keyword  | optionalArgs:boolean | variadic:boolean                
-abs                      |"integer|long|double|unsigned_long abs(n:integer|long|double|unsigned_long)"      |n                        |"integer|long|double|unsigned_long"                 | ""                                                 |"integer|long|double|unsigned_long"                    | ""                      | false                | false
-acos                     |"double acos(n:integer|long|double|unsigned_long)"     |n                        |"integer|long|double|unsigned_long"                 | ""                                                 |double                    | ""                      | false                | false
-asin                     |"double asin(n:integer|long|double|unsigned_long)"|n                        |"integer|long|double|unsigned_long"                 | ""                                                 |double               | ""                      | false                | false
-atan                     |"double atan(n:integer|long|double|unsigned_long)"     |n                        |"integer|long|double|unsigned_long"                 | ""                                                 |double                    | ""                      | false                | false
-atan2                    |"double atan2(y:integer|long|double|unsigned_long, x:integer|long|double|unsigned_long)"                                       |[y, x]                   |["integer|long|double|unsigned_long", "integer|long|double|unsigned_long"]            |["", ""]                                            |double                    | ""                      | [false, false]       | false
-auto_bucket              |"double|date auto_bucket(field:integer|long|double|date, buckets:integer, from:integer|long|double|date, to:integer|long|double|date)"           |[field, buckets, from, to] |["integer|long|double|date", "integer", "integer|long|double|date", "integer|long|double|date"]      |["", "", "", ""]                                    | "double|date"                    | ""                      | [false, false, false, false]   | false
-avg                      |? avg(arg1:?)                                           |arg1                     |?                 |   ""                                               |?                    | ""                      | false                | false
-case                     |? case(arg1:?, arg2...:?)                               |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | true
-ceil                     |"? ceil(n:integer|long|double|unsigned_long)"     |n                        |"integer|long|double|unsigned_long"                 | ""                                                 |?                    | ""                      | false                | false
-cidr_match               |? cidr_match(arg1:?, arg2...:?)                         |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | true
-coalesce                 |? coalesce(arg1:?, arg2...:?)                           |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | true
-concat                   |? concat(arg1:?, arg2...:?)                             |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | true
-cos                      |"double cos(n:integer|long|double|unsigned_long)"      |n                        |"integer|long|double|unsigned_long"                 | "An angle, in radians"  |double         | "Returns the trigonometric cosine of an angle"                      | false                | false
-cosh                     |"double cosh(n:integer|long|double|unsigned_long)"     |n                        |"integer|long|double|unsigned_long"                 | "The number who's hyperbolic cosine is to be returned" |double                    | "Returns the hyperbolic cosine of a number"                      | false                | false
-count                    |? count(arg1:?)                                         |arg1                     |?                 | ""                                                 |?                    | ""                      | false                | false
-count_distinct           |? count_distinct(arg1:?, arg2:?)                        |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | false
-date_diff                |"integer date_diff(unit:keyword|text, startTimestamp:date, endTimestamp:date)"|[unit, startTimestamp, endTimestamp] |["keyword|text", "date", "date"]  |["A valid date unit", "A string representing a start timestamp", "A string representing an end timestamp"] |integer | "Subtract 2 dates and return their difference in multiples of a unit specified in the 1st argument" | [false, false, false] | false
-date_extract             |? date_extract(arg1:?, arg2:?)                          |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | false
-date_format              |? date_format(arg1:?, arg2:?)                           |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | false
-date_parse               |"date date_parse(?datePattern:keyword, dateString:keyword|text)"|[datePattern, dateString]|["keyword", "keyword|text"]|[A valid date pattern, A string representing a date]|date                 |Parses a string into a date value | [true, false]       | false         
-date_trunc               |? date_trunc(arg1:?, arg2:?)                            |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | false
-e                        |? e()                                                   | null                    | null             | null                                               |?                    | ""                      | null                 | false
-ends_with                |? ends_with(arg1:?, arg2:?)                             |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | false
-floor                    |"? floor(n:integer|long|double|unsigned_long)"    |n                        |"integer|long|double|unsigned_long"    | ""                                                 |?                    | ""                      | false                | false
-greatest                 |"? greatest(first:integer|long|double|boolean|keyword|text|ip|version, rest...:integer|long|double|boolean|keyword|text|ip|version)"        |[first, rest]            |["integer|long|double|boolean|keyword|text|ip|version", "integer|long|double|boolean|keyword|text|ip|version"]            |["", ""]                                            |?                    | ""                      | [false, false]       | true
-least                    |"? least(first:integer|long|double|boolean|keyword|text|ip|version, rest...:integer|long|double|boolean|keyword|text|ip|version)"        |[first, rest]            |["integer|long|double|boolean|keyword|text|ip|version", "integer|long|double|boolean|keyword|text|ip|version"]            |["", ""]                                            |?                    | ""                      | [false, false]       | true
-left                     |"? left(string:keyword, length:integer)"                |[string, length]         |["keyword", "integer"]            |["", ""]                                            |?                    | ""                      | [false, false]       | false
-length                   |? length(arg1:?)                                        |arg1                     |?                 | ""                                                 |?                    | ""                      | false                | false
-log10                    |"? log10(n:integer|long|double|unsigned_long)"          |n                        |"integer|long|double|unsigned_long" | ""                                                 |?                    | ""                      | false                | false
-ltrim                    |"keyword|text ltrim(str:keyword|text)"                  |str                      |"keyword|text"    | ""                                                 |"keyword|text"       |Removes leading whitespaces from a string.| false | false
-max                      |? max(arg1:?)                                           |arg1                     |?                 | ""                                                 |?                    | ""                      | false                | false
-median                   |? median(arg1:?)                                        |arg1                     |?                 | ""                                                 |?                    | ""                      | false                | false
-median_absolute_deviation|? median_absolute_deviation(arg1:?)                     |arg1                     |?                 | ""                                                 |?                    | ""                      | false                | false
-min                      |? min(arg1:?)                                           |arg1                     |?                 | ""                                                 |?                    | ""                      | false                | false
-mv_avg                   |? mv_avg(arg1:?)                                        |arg1                     |?                 | ""                                                 |?                    | ""                      | false                | false
-mv_concat                |"keyword mv_concat(v:text|keyword, delim:text|keyword)" |[v, delim]               |["text|keyword", "text|keyword"] |["values to join", "delimiter"]      |keyword              | "Reduce a multivalued string field to a single valued field by concatenating all values." | [false, false]       | false
-mv_count                 |"integer mv_count(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point)" |v      | "unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point" | "" | integer | "Reduce a multivalued field to a single valued field containing the count of values."       | false                | false
-mv_dedupe                |"? mv_dedupe(v:boolean|date|double|ip|text|integer|keyword|version|long)" |v | "boolean|date|double|ip|text|integer|keyword|version|long" | "" |?   | "Remove duplicate values from a multivalued field."                      | false                | false
-mv_first                 |"? mv_first(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point)" |v | "unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point" | "" |?   | "Reduce a multivalued field to a single valued field containing the first value."                      | false                | false
-mv_last                  |"? mv_last(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point)" |v | "unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point" | "" |?   | "Reduce a multivalued field to a single valued field containing the last value."                      | false                | false
-mv_max                   |"? mv_max(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long)" |v | "unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long" | "" |?      | "Reduce a multivalued field to a single valued field containing the maximum value." | false                | false
-mv_median                |? mv_median(arg1:?)                                     |arg1                     |?                 | ""                                                 |?                    | ""                      | false                | false
-mv_min                   |"? mv_min(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long)" |v | "unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long" | "" |?      | "Reduce a multivalued field to a single valued field containing the minimum value." | false                | false
-mv_sum                   |? mv_sum(arg1:?)                                        |arg1                     |?                 | ""                                                 |?                    | ""                      | false                | false
-now                      |? now()                                                 | null                    |null              | null                                               |?                    | ""                      | null                 | false
-percentile               |? percentile(arg1:?, arg2:?)                            |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | false
-pi                       |? pi()                                                  | null                    |  null            | null                                               |?                    | ""                      | null                 | false
-pow                      |"? pow(base:integer|unsigned_long|long|double, exponent:integer|unsigned_long|long|double)" |[base, exponent]         |["integer|unsigned_long|long|double", "integer|unsigned_long|long|double"]           |["", ""]                                            |?                    | ""                      | [false, false]       | false
-replace                  |"? replace(arg1:?, arg2:?, arg3:?)"                       | [arg1, arg2, arg3]      | [?, ?, ?]        |["", "", ""]                                        |?                    | ""                      | [false, false, false]| false 
-right                    |"? right(string:keyword, length:integer)"     |[string, length]         |["keyword", "integer"]            |["", ""]                                            |?                    | ""                      | [false, false]       | false
-round                    |? round(arg1:?, arg2:?)                                 |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | false
-rtrim                    |"keyword|text rtrim(str:keyword|text)"                  |str                      |"keyword|text"    | ""                                                 |"keyword|text"       |Removes trailing whitespaces from a string.| false | false
-sin                      |"double sin(n:integer|long|double|unsigned_long)" |n                        |"integer|long|double|unsigned_long"           |An angle, in radians                                |double               |Returns the trigonometric sine of an angle  | false      | false
-sinh                     |"double sinh(n:integer|long|double|unsigned_long)"|n                        |"integer|long|double|unsigned_long"           | "The number to return the hyperbolic sine of"      |double                    | "Returns the hyperbolic sine of a number"                      | false                | false
-split                    |? split(arg1:?, arg2:?)                                 |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | false
-sqrt                     |"? sqrt(n:integer|long|double|unsigned_long)"     |n                        |"integer|long|double|unsigned_long"                 | ""                                                 |?                    | ""                      | false                | false
-starts_with              |? starts_with(arg1:?, arg2:?)                           |[arg1, arg2]             |[?, ?]            |["", ""]                                            |?                    | ""                      | [false, false]       | false
-substring                |? substring(arg1:?, arg2:?, arg3:?)                     |[arg1, arg2, arg3]       |[?, ?, ?]         |["", "", ""]                                        |?                    | ""                      | [false, false, false]| false
-sum                      |? sum(arg1:?)                                           |arg1                     |?                 | ""                                                 |?                    | ""                      | false                | false
-tan                      |"double tan(n:integer|long|double|unsigned_long)"      |n                        |"integer|long|double|unsigned_long"           | "An angle, in radians"  |double               | "Returns the trigonometric tangent of an angle"                      | false                | false
-tanh                     |"double tanh(n:integer|long|double|unsigned_long)"     |n                        |"integer|long|double|unsigned_long"           | "The number to return the hyperbolic tangent of" |double               | "Returns the hyperbolic tangent of a number"                      | false                | false
-tau                      |? tau()                                                 | null                    | null             | null                                               |?                    | ""                      | null                 | false
-to_bool                  |"boolean to_bool(v:boolean|keyword|text|double|long|unsigned_long|integer)"                      |v   |"boolean|keyword|text|double|long|unsigned_long|integer"                                                   |                                                    |boolean                          |                                                                                       |false                       |false          
-to_boolean               |"boolean to_boolean(v:boolean|keyword|text|double|long|unsigned_long|integer)"                   |v   |"boolean|keyword|text|double|long|unsigned_long|integer"                                                   |                                                    |boolean                          |                                                                                       |false                       |false          
-to_cartesianpoint        |"cartesian_point to_cartesianpoint(v:cartesian_point|keyword|text)"                         |v   |"cartesian_point|keyword|text"                              |                                                    |cartesian_point                  |                         |false                 |false
-to_datetime              |"date to_datetime(v:date|keyword|text|double|long|unsigned_long|integer)"                        |v   |"date|keyword|text|double|long|unsigned_long|integer"                                                      |                                                    |date                             |                                                                                       |false                       |false          
-to_dbl                   |"double to_dbl(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"                   |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |double                           |                                                                                       |false                       |false          
-to_degrees               |"double to_degrees(v:double|long|unsigned_long|integer)"                                         |v   |"double|long|unsigned_long|integer"                                                                        |                                                    |double                           |                                                                                       |false                       |false          
-to_double                |"double to_double(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"                |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |double                           |                                                                                       |false                       |false          
-to_dt                    |"date to_dt(v:date|keyword|text|double|long|unsigned_long|integer)"                              |v   |"date|keyword|text|double|long|unsigned_long|integer"                                                      |                                                    |date                             |                                                                                       |false                       |false          
-to_geopoint              |"geo_point to_geopoint(v:geo_point|keyword|text)"                                           |v   |"geo_point|keyword|text"                                                                              |                                                    |geo_point                        |                                                                                       |false                       |false          
-to_int                   |"integer to_int(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"                  |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |integer                          |                                                                                       |false                       |false          
-to_integer               |"integer to_integer(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"              |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |integer                          |                                                                                       |false                       |false          
-to_ip                    |"ip to_ip(v:ip|keyword|text)"                                                                    |v   |"ip|keyword|text"                                                                                          |                                                    |ip                               |                                                                                       |false                       |false          
-to_long                  |"long to_long(v:boolean|date|keyword|text|double|long|unsigned_long|integer|geo_point|cartesian_point)"                               |v                         |"boolean|date|keyword|text|double|long|unsigned_long|integer|geo_point|cartesian_point"                     |                                                    |long                             |                                                                                       |false                       |false
-to_radians               |"double to_radians(v:double|long|unsigned_long|integer)"                                         |v   |"double|long|unsigned_long|integer"                                                                        |                                                    |double                           |                                                                                       |false                       |false
-to_str                   |"keyword to_str(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point)"                  |v                         |"unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point"          |                                                    |keyword                          |                                                                                       |false                       |false
-to_string                |"keyword to_string(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point)"               |v                         |"unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point"          |                                                    |keyword                          |                                                                                       |false                       |false
-to_ul                    |"unsigned_long to_ul(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"             |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |unsigned_long                    |                                                                                       |false                       |false          
-to_ulong                 |"unsigned_long to_ulong(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"          |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |unsigned_long                    |                                                                                       |false                       |false          
-to_unsigned_long         |"unsigned_long to_unsigned_long(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"  |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |unsigned_long                    |                                                                                       |false                       |false          
-to_ver                   |"version to_ver(v:keyword|text|version)"                                                         |v   |"keyword|text|version"                                                                                     |                                                    |version                          |                                                                                       |false                       |false          
-to_version               |"version to_version(v:keyword|text|version)"                                                     |v   |"keyword|text|version"                                                                                     |                                                    |version                          |                                                                                       |false                       |false          
-trim                     |"keyword|text trim(str:keyword|text)"                   |str                      |"keyword|text"    | ""                                                 |"keyword|text"       |Removes leading and trailing whitespaces from a string.| false | false
+       name:keyword      |                        synopsis:keyword          |       argNames:keyword  | argTypes:keyword |             argDescriptions:keyword                |returnType:keyword   |    description:keyword  | optionalArgs:boolean | variadic:boolean | isAggregation:boolean               
+abs                      |"double|integer|long|unsigned_long abs(n:double|integer|long|unsigned_long)"      |n                        |"double|integer|long|unsigned_long"                 | ""                                                 |"double|integer|long|unsigned_long"                    | "Returns the absolute value."                      | false                | false | false
+acos                     |"double acos(n:double|integer|long|unsigned_long)"     |n                        |"double|integer|long|unsigned_long"                 | ""                                                 |double                    | "The arccosine of an angle, expressed in radians."                      | false                | false | false
+asin                     |"double asin(n:double|integer|long|unsigned_long)"|n                        |"double|integer|long|unsigned_long"                 | ""                                                 |double               | "Inverse sine trigonometric function."                      | false                | false | false
+atan                     |"double atan(n:double|integer|long|unsigned_long)"     |n                        |"double|integer|long|unsigned_long"                 | ""                                                 |double                    | "Inverse tangent trigonometric function."                      | false                | false | false
+atan2                    |"double atan2(y:double|integer|long|unsigned_long, x:double|integer|long|unsigned_long)"                                       |[y, x]                   |["double|integer|long|unsigned_long", "double|integer|long|unsigned_long"]            |["", ""]                                            |double                    | "The angle between the positive x-axis and the ray from the origin to the point (x , y) in the Cartesian plane."                      | [false, false]       | false | false
+auto_bucket              |"double|date auto_bucket(field:integer|long|double|date, buckets:integer, from:integer|long|double|date, to:integer|long|double|date)"           |[field, buckets, from, to] |["integer|long|double|date", "integer", "integer|long|double|date", "integer|long|double|date"]      |["", "", "", ""]                                    | "double|date"                    | "Creates human-friendly buckets and returns a datetime value for each row that corresponds to the resulting bucket the row falls into."                      | [false, false, false, false]   | false | false
+avg                      |"double avg(field:double|integer|long|unsigned_long)"                                           |field                     |"double|integer|long|unsigned_long"                 |   ""                                               |double                    | "The average of a numeric field."                      | false                | false | true
+case                     |"boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version case(condition:boolean, rest...:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)"                               |[condition, rest]             |["boolean", "boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version"]            |["", ""]                                            |"boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version"                    | "Accepts pairs of conditions and values. The function returns the value that belongs to the first condition that evaluates to true."                      | [false, false]       | true | false
+ceil                     |"double|integer|long|unsigned_long ceil(n:double|integer|long|unsigned_long)"     |n                        |"double|integer|long|unsigned_long"                 | ""                                                 | "double|integer|long|unsigned_long"                    | "Round a number up to the nearest integer."                      | false                | false | false
+cidr_match               |boolean cidr_match(ip:ip, blockX...:keyword)                         |[ip, blockX]             |[ip, keyword]            |["", "CIDR block to test the IP against."]                                            |boolean                    | "Returns true if the provided IP is contained in one of the provided CIDR blocks."                      | [false, false]       | true | false
+coalesce                 |"boolean|text|integer|keyword|long coalesce(expression:boolean|text|integer|keyword|long, expressionX...:boolean|text|integer|keyword|long)"                           |[expression, expressionX]             |["boolean|text|integer|keyword|long", "boolean|text|integer|keyword|long"]            |["Expression to evaluate", "Other expression to evaluate"]                                            |"boolean|text|integer|keyword|long"                    | "Returns the first of its arguments that is not null."                      | [false, false]       | true | false
+concat                   |"keyword concat(first:keyword|text, rest...:keyword|text)"                             |[first, rest]             |["keyword|text", "keyword|text"]            |["", ""]                                            |keyword                    | "Concatenates two or more strings."                      | [false, false]       | true | false
+cos                      |"double cos(n:double|integer|long|unsigned_long)"      |n                        |"double|integer|long|unsigned_long"                 | "An angle, in radians"  |double         | "Returns the trigonometric cosine of an angle"                      | false                | false | false
+cosh                     |"double cosh(n:double|integer|long|unsigned_long)"     |n                        |"double|integer|long|unsigned_long"                 | "The number who's hyperbolic cosine is to be returned" |double                    | "Returns the hyperbolic cosine of a number"                      | false                | false | false
+count                    |"long count(?field:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)"                                         |field                     |"boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version"                 | "Column or literal for which to count the number of values."                                                 |long                    | "Returns the total number (count) of input values."                      | true                | false | true
+count_distinct           |"long count_distinct(field:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version, ?precision:integer)"                        |[field, precision]             |["boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version, integer"]            |["Column or literal for which to count the number of distinct values.", ""]                                            |long                    | "Returns the approximate number of distinct values."                      | [false, true]       | false | true
+date_diff                |"integer date_diff(unit:keyword|text, startTimestamp:date, endTimestamp:date)"|[unit, startTimestamp, endTimestamp] |["keyword|text", "date", "date"]  |["A valid date unit", "A string representing a start timestamp", "A string representing an end timestamp"] |integer | "Subtract 2 dates and return their difference in multiples of a unit specified in the 1st argument" | [false, false, false] | false | false
+date_extract             |long date_extract(date_part:keyword, field:date)                          |[date_part, field]             |[keyword, date]            |["Part of the date to extract. Can be: aligned_day_of_week_in_month; aligned_day_of_week_in_year; aligned_week_of_month; aligned_week_of_year; ampm_of_day; clock_hour_of_ampm; clock_hour_of_day; day_of_month; day_of_week; day_of_year; epoch_day; era; hour_of_ampm; hour_of_day; instant_seconds; micro_of_day; micro_of_second; milli_of_day; milli_of_second; minute_of_day; minute_of_hour; month_of_year; nano_of_day; nano_of_second; offset_seconds; proleptic_month; second_of_day; second_of_minute; year; or year_of_era.", "Date expression"]                                            |long                    | "Extracts parts of a date, like year, month, day, hour."                      | [false, false]       | false | false
+date_format              |keyword date_format(?format:keyword, date:date)                           |[format, date]             |[keyword, date]            |["A valid date pattern", "Date expression"]                                            |keyword                    | "Returns a string representation of a date, in the provided format."                      | [true, false]       | false | false
+date_parse               |"date date_parse(?datePattern:keyword, dateString:keyword|text)"|[datePattern, dateString]|["keyword", "keyword|text"]|["A valid date pattern", "A string representing a date"]|date                 |Parses a string into a date value | [true, false]       | false          | false
+date_trunc               |"date date_trunc(interval:keyword, date:date)"                            |[interval, date]             |[keyword, date]            |["Interval; expressed using the timespan literal syntax.", "Date expression"]                                            |date                    | "Rounds down a date to the closest interval."                      | [false, false]       | false | false
+e                        |double e()                                                   | null                    | null             | null                                               |double                    | "Euler’s number."                      | null                 | false | false
+ends_with                |"boolean ends_with(str:keyword|text, suffix:keyword|text)"                             |[str, suffix]             |["keyword|text", "keyword|text"]            |["", ""]                                            |boolean                    | "Returns a boolean that indicates whether a keyword string ends with another string"                      | [false, false]       | false | false
+floor                    |"double|integer|long|unsigned_long floor(n:double|integer|long|unsigned_long)"    |n                        |"double|integer|long|unsigned_long"    | ""                                                 |"double|integer|long|unsigned_long"                    | "Round a number down to the nearest integer."                      | false                | false | false
+greatest                 |"integer|long|double|boolean|keyword|text|ip|version greatest(first:integer|long|double|boolean|keyword|text|ip|version, rest...:integer|long|double|boolean|keyword|text|ip|version)"        |[first, rest]            |["integer|long|double|boolean|keyword|text|ip|version", "integer|long|double|boolean|keyword|text|ip|version"]            |["", ""]                                            |"integer|long|double|boolean|keyword|text|ip|version"                    | "Returns the maximum value from many columns."                      | [false, false]       | true | false
+least                    |"integer|long|double|boolean|keyword|text|ip|version least(first:integer|long|double|boolean|keyword|text|ip|version, rest...:integer|long|double|boolean|keyword|text|ip|version)"        |[first, rest]            |["integer|long|double|boolean|keyword|text|ip|version", "integer|long|double|boolean|keyword|text|ip|version"]            |["", ""]                                            |"integer|long|double|boolean|keyword|text|ip|version"                    | "Returns the minimum value from many columns."                      | [false, false]       | true | false
+left                     |"keyword left(str:keyword|text, length:integer)"                |[str, length]         |["keyword|text", "integer"]            |["", ""]                                            |keyword                    | "Return the substring that extracts length chars from the string starting from the left."                      | [false, false]       | false | false
+length                   |"integer length(str:keyword|text)"                                        |str                     |"keyword|text"                 | ""                                                 |integer                    | "Returns the character length of a string."                      | false                | false | false
+log10                    |"double log10(n:double|integer|long|unsigned_long)"          |n                        |"double|integer|long|unsigned_long" | ""                                                 |double                    | "Returns the log base 10."                      | false                | false | false
+ltrim                    |"keyword|text ltrim(str:keyword|text)"                  |str                      |"keyword|text"    | ""                                                 |"keyword|text"       |Removes leading whitespaces from a string.| false | false | false
+max                      |"double|integer|long|unsigned_long max(field:double|integer|long|unsigned_long)"                                           |field                     |"double|integer|long|unsigned_long"                 | ""                                                 |"double|integer|long|unsigned_long"                    | "The maximum value of a numeric field."                      | false                | false | true
+median                   |"double|integer|long|unsigned_long median(field:double|integer|long|unsigned_long)"                                        |field                     |"double|integer|long|unsigned_long"                 | ""                                                 |"double|integer|long|unsigned_long"                    | "The value that is greater than half of all values and less than half of all values."                      | false                | false | true
+median_absolute_deviation|"double|integer|long|unsigned_long median_absolute_deviation(field:double|integer|long|unsigned_long)"                     |field                     |"double|integer|long|unsigned_long"                 | ""                                                 |"double|integer|long|unsigned_long"                    | "The median absolute deviation, a measure of variability."                      | false                | false | true
+min                      |"double|integer|long|unsigned_long min(field:double|integer|long|unsigned_long)"                                           |field                     |"double|integer|long|unsigned_long"                 | ""                                                 |"double|integer|long|unsigned_long"                    | "The minimum value of a numeric field."                      | false                | false | true
+mv_avg                   |"double mv_avg(field:double|integer|long|unsigned_long)"                                        |field                     |"double|integer|long|unsigned_long"                 | ""                                                 |double                    | "Converts a multivalued field into a single valued field containing the average of all of the values."                      | false                | false | false
+mv_concat                |"keyword mv_concat(v:text|keyword, delim:text|keyword)" |[v, delim]               |["text|keyword", "text|keyword"] |["values to join", "delimiter"]      |keyword              | "Reduce a multivalued string field to a single valued field by concatenating all values." | [false, false]       | false | false
+mv_count                 |"integer mv_count(v:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)" |v      | "boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version" | "" | integer | "Reduce a multivalued field to a single valued field containing the count of values."       | false                | false | false
+mv_dedupe                |"boolean|date|double|integer|ip|keyword|long|text|version mv_dedupe(v:boolean|date|double|integer|ip|keyword|long|text|version)" |v | "boolean|date|double|integer|ip|keyword|long|text|version" | "" |"boolean|date|double|integer|ip|keyword|long|text|version"   | "Remove duplicate values from a multivalued field."                      | false                | false | false
+mv_first                 |"boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version mv_first(v:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)" |v | "boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version" | "" |"boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version"   | "Reduce a multivalued field to a single valued field containing the first value."                      | false                | false | false
+mv_last                  |"boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version mv_last(v:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)" |v | "boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version" | "" |"boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version"   | "Reduce a multivalued field to a single valued field containing the last value."                      | false                | false | false
+mv_max                   |"boolean|date|double|integer|ip|keyword|long|text|unsigned_long|version mv_max(v:boolean|date|double|integer|ip|keyword|long|text|unsigned_long|version)" |v | "boolean|date|double|integer|ip|keyword|long|text|unsigned_long|version" | "" |"boolean|date|double|integer|ip|keyword|long|text|unsigned_long|version"      | "Reduce a multivalued field to a single valued field containing the maximum value." | false                | false | false
+mv_median                |"double|integer|long|unsigned_long mv_median(v:double|integer|long|unsigned_long)"                                     |v                     |"double|integer|long|unsigned_long"                 | ""                                                 |"double|integer|long|unsigned_long"                    | "Converts a multivalued field into a single valued field containing the median value."                      | false                | false | false
+mv_min                   |"boolean|date|double|integer|ip|keyword|long|text|unsigned_long|version mv_min(v:boolean|date|double|integer|ip|keyword|long|text|unsigned_long|version)" |v | "boolean|date|double|integer|ip|keyword|long|text|unsigned_long|version" | "" |"boolean|date|double|integer|ip|keyword|long|text|unsigned_long|version"      | "Reduce a multivalued field to a single valued field containing the minimum value." | false                | false | false
+mv_sum                   |"double|integer|long|unsigned_long mv_sum(v:double|integer|long|unsigned_long)"                                        |v                     |"double|integer|long|unsigned_long"                 | ""                                                 |"double|integer|long|unsigned_long"                    | "Converts a multivalued field into a single valued field containing the sum of all of the values."                      | false                | false | false
+now                      |date now()                                                 | null                    |null              | null                                               |date                    | "Returns current date and time."                      | null                 | false | false
+percentile               |"double|integer|long|unsigned_long percentile(field:double|integer|long|unsigned_long, percentile:double|integer|long)"                            |[field, percentile]             |["double|integer|long|unsigned_long, double|integer|long"]            |["", ""]                                            |"double|integer|long|unsigned_long"                    | "The value at which a certain percentage of observed values occur."                      | [false, false]       | false | true
+pi                       |double pi()                                                  | null                    |  null            | null                                               |double                    | "The ratio of a circle’s circumference to its diameter."                      | null                 | false | false
+pow                      |"double pow(base:double|integer|long|unsigned_long, exponent:double|integer|long|unsigned_long)" |[base, exponent]         |["double|integer|long|unsigned_long", "double|integer|long|unsigned_long"]           |["", ""]                                            |double                    | "Returns the value of a base raised to the power of an exponent."                      | [false, false]       | false | false
+replace                  |"keyword replace(str:keyword|text, regex:keyword|text, newStr:keyword|text)"                       | [str, regex, newStr]      | ["keyword|text", "keyword|text", "keyword|text"]        |["", "", ""]                                        |keyword                    | "The function substitutes in the string any match of the regular expression with the replacement string."                      | [false, false, false]| false  | false
+right                    |"keyword right(str:keyword|text, length:integer)"     |[str, length]         |["keyword|text", "integer"]            |["", ""]                                            |keyword                    | "Return the substring that extracts length chars from the string starting from the right."                      | [false, false]       | false | false
+round                    |"double round(value:double, ?decimals:integer)"                                 |[value, decimals]             |["double", "integer"]            |["The numeric value to round", "The number of decimal places to round to. Defaults to 0."]                                            |double                    | "Rounds a number to the closest number with the specified number of digits."                      | [false, true]       | false | false
+rtrim                    |"keyword|text rtrim(str:keyword|text)"                  |str                      |"keyword|text"    | ""                                                 |"keyword|text"       |Removes trailing whitespaces from a string.| false | false | false
+sin                      |"double sin(n:double|integer|long|unsigned_long)" |n                        |"double|integer|long|unsigned_long"           |"An angle, in radians"                                |double               |Returns the trigonometric sine of an angle  | false      | false | false
+sinh                     |"double sinh(n:double|integer|long|unsigned_long)"|n                        |"double|integer|long|unsigned_long"           |"The number to return the hyperbolic sine of"      |double                    | "Returns the hyperbolic sine of a number"                      | false                | false | false
+split                    |"keyword split(str:keyword|text, delim:keyword|text)"                                 |[str, delim]             |["keyword|text", "keyword|text"]            |["", ""]                                            |keyword                    | "Split a single valued string into multiple strings."                      | [false, false]       | false | false
+sqrt                     |"double sqrt(n:double|integer|long|unsigned_long)"     |n                        |"double|integer|long|unsigned_long"                 | ""                                                 |double                    | "Returns the square root of a number."                      | false                | false | false
+starts_with              |"boolean starts_with(str:keyword|text, prefix:keyword|text)"                           |[str, prefix]             |["keyword|text", "keyword|text"]            |["", ""]                                            |boolean                    | "Returns a boolean that indicates whether a keyword string starts with another string"                      | [false, false]       | false | false
+substring                |"keyword substring(str:keyword|text, start:integer, ?length:integer)"                     |[str, start, length]       |["keyword|text", "integer", "integer"]         |["", "", ""]                                        |keyword                    | "Returns a substring of a string, specified by a start position and an optional length"                      | [false, false, true]| false | false
+sum                      |"long sum(field:double|integer|long|unsigned_long)"                                          |field                     |"double|integer|long|unsigned_long"                 | ""                                                 |long                    | "The sum of a numeric field."                      | false                | false | true
+tan                      |"double tan(n:double|integer|long|unsigned_long)"      |n                        |"double|integer|long|unsigned_long"           | "An angle, in radians"  |double               | "Returns the trigonometric tangent of an angle"                      | false                | false | false
+tanh                     |"double tanh(n:double|integer|long|unsigned_long)"     |n                        |"double|integer|long|unsigned_long"           | "The number to return the hyperbolic tangent of" |double               | "Returns the hyperbolic tangent of a number"                      | false                | false | false
+tau                      |double tau()                                                 | null                    | null             | null                                               |double                    | "The ratio of a circle’s circumference to its radius."                      | null                 | false | false
+to_bool                  |"boolean to_bool(v:boolean|keyword|text|double|long|unsigned_long|integer)"                      |v   |"boolean|keyword|text|double|long|unsigned_long|integer"                                                   |                                                    |boolean                          | "Converts an input value to a boolean value."                                                                                      |false                       |false           | false
+to_boolean               |"boolean to_boolean(v:boolean|keyword|text|double|long|unsigned_long|integer)"                   |v   |"boolean|keyword|text|double|long|unsigned_long|integer"                                                   |                                                    |boolean                          | "Converts an input value to a boolean value."                                                                                      |false                       |false           | false
+to_cartesianpoint        |"cartesian_point to_cartesianpoint(v:cartesian_point|keyword|text)"                         |v   |"cartesian_point|keyword|text"                              |                                                    |cartesian_point                  | "Converts an input value to a point value."                        |false                 |false | false
+to_datetime              |"date to_datetime(v:date|keyword|text|double|long|unsigned_long|integer)"                        |v   |"date|keyword|text|double|long|unsigned_long|integer"                                                      |                                                    |date                             | "Converts an input value to a date value."                                                                                      |false                       |false           | false
+to_dbl                   |"double to_dbl(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"                   |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |double                           | "Converts an input value to a double value."                                                                                      |false                       |false           | false
+to_degrees               |"double to_degrees(v:double|integer|long|unsigned_long)"                                         |v   |"double|integer|long|unsigned_long"                                                                        |                                                    |double                           | "Converts a number in radians to degrees."                                                                                      |false                       |false           | false
+to_double                |"double to_double(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"                |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |double                           | "Converts an input value to a double value."                                                                                      |false                       |false           | false
+to_dt                    |"date to_dt(v:date|keyword|text|double|long|unsigned_long|integer)"                              |v   |"date|keyword|text|double|long|unsigned_long|integer"                                                      |                                                    |date                             | "Converts an input value to a date value."                                                                                      |false                       |false           | false
+to_geopoint              |"geo_point to_geopoint(v:geo_point|keyword|text)"                                           |v   |"geo_point|keyword|text"                                                                              |                                                    |geo_point                        | "Converts an input value to a geo_point value."                                                                                     |false                       |false           | false
+to_int                   |"integer to_int(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"                  |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |integer                          | "Converts an input value to an integer value."                                                                                      |false                       |false           | false
+to_integer               |"integer to_integer(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"              |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |integer                          | "Converts an input value to an integer value."                                                                                      |false                       |false           | false
+to_ip                    |"ip to_ip(v:ip|keyword|text)"                                                                    |v   |"ip|keyword|text"                                                                                          |                                                    |ip                               | "Converts an input string to an IP value."                                                                                      |false                       |false           | false
+to_long                  |"long to_long(v:boolean|date|keyword|text|double|long|unsigned_long|integer|geo_point|cartesian_point)"                               |v                         |"boolean|date|keyword|text|double|long|unsigned_long|integer|geo_point|cartesian_point"                     |                                                    |long                             | "Converts an input value to a long value."                                                                                      |false                       |false | false
+to_radians               |"double to_radians(v:double|integer|long|unsigned_long)"                                         |v   |"double|integer|long|unsigned_long"                                                                        |                                                    |double                           | "Converts a number in degrees to radians."                                                                                      |false                       |false | false
+to_str                   |"keyword to_str(v:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)"                  |v                         |"boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version"          |                                                    |keyword                          | "Converts a field into a string."                                                                                      |false                       |false | false
+to_string                |"keyword to_string(v:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)"               |v                         |"boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version"          |                                                    |keyword                          | "Converts a field into a string."                                                                                      |false                       |false | false
+to_ul                    |"unsigned_long to_ul(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"             |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |unsigned_long                    | "Converts an input value to an unsigned long value."                                                                                      |false                       |false           | false
+to_ulong                 |"unsigned_long to_ulong(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"          |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |unsigned_long                    | "Converts an input value to an unsigned long value."                                                                                      |false                       |false           | false
+to_unsigned_long         |"unsigned_long to_unsigned_long(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"  |v   |"boolean|date|keyword|text|double|long|unsigned_long|integer"                                              |                                                    |unsigned_long                    | "Converts an input value to an unsigned long value."                                                                                      |false                       |false           | false
+to_ver                   |"version to_ver(v:keyword|text|version)"                                                         |v   |"keyword|text|version"                                                                                     |                                                    |version                          | "Converts an input string to a version value."                                                                                     |false                       |false           | false
+to_version               |"version to_version(v:keyword|text|version)"                                                     |v   |"keyword|text|version"                                                                                     |                                                    |version                          | "Converts an input string to a version value."                                                                                       |false                       |false           | false
+trim                     |"keyword|text trim(str:keyword|text)"                   |str                      |"keyword|text"    | ""                                                 |"keyword|text"       | "Removes leading and trailing whitespaces from a string." | false | false | false
 ;
 
 
@@ -101,74 +101,74 @@ showFunctionsSynopsis#[skip:-8.12.99]
 show functions | keep synopsis;
 
 synopsis:keyword
-"integer|long|double|unsigned_long abs(n:integer|long|double|unsigned_long)"
-"double acos(n:integer|long|double|unsigned_long)"
-"double asin(n:integer|long|double|unsigned_long)"
-"double atan(n:integer|long|double|unsigned_long)"
-"double atan2(y:integer|long|double|unsigned_long, x:integer|long|double|unsigned_long)"
+"double|integer|long|unsigned_long abs(n:double|integer|long|unsigned_long)"
+"double acos(n:double|integer|long|unsigned_long)"
+"double asin(n:double|integer|long|unsigned_long)"
+"double atan(n:double|integer|long|unsigned_long)"
+"double atan2(y:double|integer|long|unsigned_long, x:double|integer|long|unsigned_long)"
 "double|date auto_bucket(field:integer|long|double|date, buckets:integer, from:integer|long|double|date, to:integer|long|double|date)"
-? avg(arg1:?)
-? case(arg1:?, arg2...:?)
-"? ceil(n:integer|long|double|unsigned_long)"
-? cidr_match(arg1:?, arg2...:?)
-? coalesce(arg1:?, arg2...:?)
-? concat(arg1:?, arg2...:?)
-"double cos(n:integer|long|double|unsigned_long)"
-"double cosh(n:integer|long|double|unsigned_long)"
-? count(arg1:?)
-? count_distinct(arg1:?, arg2:?)
+"double avg(field:double|integer|long|unsigned_long)"
+"boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version case(condition:boolean, rest...:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)"
+"double|integer|long|unsigned_long ceil(n:double|integer|long|unsigned_long)"
+boolean cidr_match(ip:ip, blockX...:keyword) 
+"boolean|text|integer|keyword|long coalesce(expression:boolean|text|integer|keyword|long, expressionX...:boolean|text|integer|keyword|long)"
+"keyword concat(first:keyword|text, rest...:keyword|text)"
+"double cos(n:double|integer|long|unsigned_long)"
+"double cosh(n:double|integer|long|unsigned_long)"
+"long count(?field:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)"
+"long count_distinct(field:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version, ?precision:integer)"
 "integer date_diff(unit:keyword|text, startTimestamp:date, endTimestamp:date)"
-? date_extract(arg1:?, arg2:?)
-? date_format(arg1:?, arg2:?)
+long date_extract(date_part:keyword, field:date)
+keyword date_format(?format:keyword, date:date)
 "date date_parse(?datePattern:keyword, dateString:keyword|text)"
-? date_trunc(arg1:?, arg2:?)
-? e()
-? ends_with(arg1:?, arg2:?)
-"? floor(n:integer|long|double|unsigned_long)"
-"? greatest(first:integer|long|double|boolean|keyword|text|ip|version, rest...:integer|long|double|boolean|keyword|text|ip|version)"
-"? least(first:integer|long|double|boolean|keyword|text|ip|version, rest...:integer|long|double|boolean|keyword|text|ip|version)"
-? left(string:keyword, length:integer)
-? length(arg1:?)
-"? log10(n:integer|long|double|unsigned_long)"
+"date date_trunc(interval:keyword, date:date)"
+double e()
+"boolean ends_with(str:keyword|text, suffix:keyword|text)"
+"double|integer|long|unsigned_long floor(n:double|integer|long|unsigned_long)"
+"integer|long|double|boolean|keyword|text|ip|version greatest(first:integer|long|double|boolean|keyword|text|ip|version, rest...:integer|long|double|boolean|keyword|text|ip|version)"
+"integer|long|double|boolean|keyword|text|ip|version least(first:integer|long|double|boolean|keyword|text|ip|version, rest...:integer|long|double|boolean|keyword|text|ip|version)"
+"keyword left(str:keyword|text, length:integer)"
+"integer length(str:keyword|text)"
+"double log10(n:double|integer|long|unsigned_long)"
 "keyword|text ltrim(str:keyword|text)"
-? max(arg1:?)
-? median(arg1:?)
-? median_absolute_deviation(arg1:?)
-? min(arg1:?)
-? mv_avg(arg1:?)
+"double|integer|long|unsigned_long max(field:double|integer|long|unsigned_long)"
+"double|integer|long|unsigned_long median(field:double|integer|long|unsigned_long)"
+"double|integer|long|unsigned_long median_absolute_deviation(field:double|integer|long|unsigned_long)"
+"double|integer|long|unsigned_long min(field:double|integer|long|unsigned_long)"
+"double mv_avg(field:double|integer|long|unsigned_long)"
 "keyword mv_concat(v:text|keyword, delim:text|keyword)"
-"integer mv_count(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point)"
-"? mv_dedupe(v:boolean|date|double|ip|text|integer|keyword|version|long)"
-"? mv_first(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point)"
-"? mv_last(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point)"
-"? mv_max(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long)"
-? mv_median(arg1:?)
-"? mv_min(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long)"
-? mv_sum(arg1:?)
-? now()
-? percentile(arg1:?, arg2:?)
-? pi()
-"? pow(base:integer|unsigned_long|long|double, exponent:integer|unsigned_long|long|double)"
-? replace(arg1:?, arg2:?, arg3:?)
-? right(string:keyword, length:integer)
-? round(arg1:?, arg2:?)
+"integer mv_count(v:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)"
+"boolean|date|double|integer|ip|keyword|long|text|version mv_dedupe(v:boolean|date|double|integer|ip|keyword|long|text|version)"
+"boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version mv_first(v:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)"
+"boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version mv_last(v:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)"
+"boolean|date|double|integer|ip|keyword|long|text|unsigned_long|version mv_max(v:boolean|date|double|integer|ip|keyword|long|text|unsigned_long|version)"
+"double|integer|long|unsigned_long mv_median(v:double|integer|long|unsigned_long)"
+"boolean|date|double|integer|ip|keyword|long|text|unsigned_long|version mv_min(v:boolean|date|double|integer|ip|keyword|long|text|unsigned_long|version)"
+"double|integer|long|unsigned_long mv_sum(v:double|integer|long|unsigned_long)"
+date now()
+"double|integer|long|unsigned_long percentile(field:double|integer|long|unsigned_long, percentile:double|integer|long)"
+double pi()
+"double pow(base:double|integer|long|unsigned_long, exponent:double|integer|long|unsigned_long)"
+"keyword replace(str:keyword|text, regex:keyword|text, newStr:keyword|text)"
+"keyword right(str:keyword|text, length:integer)"
+"double round(value:double, ?decimals:integer)"
 "keyword|text rtrim(str:keyword|text)"
-"double sin(n:integer|long|double|unsigned_long)"
-"double sinh(n:integer|long|double|unsigned_long)"
-? split(arg1:?, arg2:?)
-"? sqrt(n:integer|long|double|unsigned_long)"
-? starts_with(arg1:?, arg2:?)
-? substring(arg1:?, arg2:?, arg3:?)
-? sum(arg1:?)
-"double tan(n:integer|long|double|unsigned_long)"
-"double tanh(n:integer|long|double|unsigned_long)"
-? tau()
+"double sin(n:double|integer|long|unsigned_long)"
+"double sinh(n:double|integer|long|unsigned_long)"
+"keyword split(str:keyword|text, delim:keyword|text)"
+"double sqrt(n:double|integer|long|unsigned_long)"
+"boolean starts_with(str:keyword|text, prefix:keyword|text)"
+"keyword substring(str:keyword|text, start:integer, ?length:integer)"
+"long sum(field:double|integer|long|unsigned_long)"
+"double tan(n:double|integer|long|unsigned_long)"
+"double tanh(n:double|integer|long|unsigned_long)"
+double tau()
 "boolean to_bool(v:boolean|keyword|text|double|long|unsigned_long|integer)"
 "boolean to_boolean(v:boolean|keyword|text|double|long|unsigned_long|integer)"
 "cartesian_point to_cartesianpoint(v:cartesian_point|keyword|text)"                                                                  
 "date to_datetime(v:date|keyword|text|double|long|unsigned_long|integer)"
 "double to_dbl(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"
-"double to_degrees(v:double|long|unsigned_long|integer)"
+"double to_degrees(v:double|integer|long|unsigned_long)"
 "double to_double(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"
 "date to_dt(v:date|keyword|text|double|long|unsigned_long|integer)"
 "geo_point to_geopoint(v:geo_point|keyword|text)"                                                                  
@@ -176,9 +176,9 @@ synopsis:keyword
 "integer to_integer(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"
 "ip to_ip(v:ip|keyword|text)"
 "long to_long(v:boolean|date|keyword|text|double|long|unsigned_long|integer|geo_point|cartesian_point)"
-"double to_radians(v:double|long|unsigned_long|integer)"
-"keyword to_str(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point)"
-"keyword to_string(v:unsigned_long|date|boolean|double|ip|text|integer|keyword|version|long|geo_point|cartesian_point)"
+"double to_radians(v:double|integer|long|unsigned_long)"
+"keyword to_str(v:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)"
+"keyword to_string(v:boolean|cartesian_point|date|double|geo_point|integer|ip|keyword|long|text|unsigned_long|version)"
 "unsigned_long to_ul(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"
 "unsigned_long to_ulong(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"
 "unsigned_long to_unsigned_long(v:boolean|date|keyword|text|double|long|unsigned_long|integer)"
@@ -196,9 +196,9 @@ SHOW functions
 ;
 
 // tag::showFunctionsFiltered-result[]
-       name:keyword      |                        synopsis:keyword                |       argNames:keyword  | argTypes:keyword |  argDescriptions:keyword | returnType:keyword |   description:keyword  |   optionalArgs:boolean |  variadic:boolean
-sin                      | "double sin(n:integer|long|double|unsigned_long)"      |n      |"integer|long|double|unsigned_long" | "An angle, in radians"   | double             | "Returns the trigonometric sine of an angle" | false | false
-sinh                     | "double sinh(n:integer|long|double|unsigned_long)"     |n      |"integer|long|double|unsigned_long" | "The number to return the hyperbolic sine of" | "double" | "Returns the hyperbolic sine of a number" | false | false
+       name:keyword      |                        synopsis:keyword                |       argNames:keyword  | argTypes:keyword |  argDescriptions:keyword | returnType:keyword |   description:keyword  |   optionalArgs:boolean |  variadic:boolean | isAggregation:boolean
+sin                      | "double sin(n:double|integer|long|unsigned_long)"      |n      |"double|integer|long|unsigned_long" | "An angle, in radians"   | double             | "Returns the trigonometric sine of an angle" | false | false | false
+sinh                     | "double sinh(n:double|integer|long|unsigned_long)"     |n      |"double|integer|long|unsigned_long" | "The number to return the hyperbolic sine of" | "double" | "Returns the hyperbolic sine of a number" | false | false | false
 // end::showFunctionsFiltered-result[]
 ;
 

+ 2 - 1
x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/EsqlActionIT.java

@@ -1049,7 +1049,8 @@ public class EsqlActionIT extends AbstractEsqlIntegTestCase {
                         new ColumnInfo("returnType", "keyword"),
                         new ColumnInfo("description", "keyword"),
                         new ColumnInfo("optionalArgs", "boolean"),
-                        new ColumnInfo("variadic", "boolean")
+                        new ColumnInfo("variadic", "boolean"),
+                        new ColumnInfo("isAggregation", "boolean")
                     )
                 )
             );

+ 13 - 5
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java

@@ -210,7 +210,14 @@ public final class EsqlFunctionRegistry extends FunctionRegistry {
 
     public record ArgSignature(String name, String[] type, String description, boolean optional) {}
 
-    public record FunctionDescription(String name, List<ArgSignature> args, String[] returnType, String description, boolean variadic) {
+    public record FunctionDescription(
+        String name,
+        List<ArgSignature> args,
+        String[] returnType,
+        String description,
+        boolean variadic,
+        boolean isAggregation
+    ) {
         public String fullSignature() {
             StringBuilder builder = new StringBuilder();
             builder.append(ShowFunctions.withPipes(returnType));
@@ -245,29 +252,30 @@ public final class EsqlFunctionRegistry extends FunctionRegistry {
     public static FunctionDescription description(FunctionDefinition def) {
         var constructors = def.clazz().getConstructors();
         if (constructors.length == 0) {
-            return new FunctionDescription(def.name(), List.of(), null, null, false);
+            return new FunctionDescription(def.name(), List.of(), null, null, false, false);
         }
         Constructor<?> constructor = constructors[0];
         FunctionInfo functionInfo = constructor.getAnnotation(FunctionInfo.class);
-        String functionDescription = functionInfo == null ? "" : functionInfo.description();
+        String functionDescription = functionInfo == null ? "" : functionInfo.description().replaceAll(System.lineSeparator(), " ");
         String[] returnType = functionInfo == null ? new String[] { "?" } : functionInfo.returnType();
         var params = constructor.getParameters(); // no multiple c'tors supported
 
         List<EsqlFunctionRegistry.ArgSignature> args = new ArrayList<>(params.length);
         boolean variadic = false;
+        boolean isAggregation = functionInfo == null ? false : functionInfo.isAggregation();
         for (int i = 1; i < params.length; i++) { // skipping 1st argument, the source
             if (Configuration.class.isAssignableFrom(params[i].getType()) == false) {
                 Param paramInfo = params[i].getAnnotation(Param.class);
                 String name = paramInfo == null ? params[i].getName() : paramInfo.name();
                 variadic |= List.class.isAssignableFrom(params[i].getType());
                 String[] type = paramInfo == null ? new String[] { "?" } : paramInfo.type();
-                String desc = paramInfo == null ? "" : paramInfo.description();
+                String desc = paramInfo == null ? "" : paramInfo.description().replaceAll(System.lineSeparator(), " ");
                 boolean optional = paramInfo == null ? false : paramInfo.optional();
 
                 args.add(new EsqlFunctionRegistry.ArgSignature(name, type, desc, optional));
             }
         }
-        return new FunctionDescription(def.name(), args, returnType, functionDescription, variadic);
+        return new FunctionDescription(def.name(), args, returnType, functionDescription, variadic, isAggregation);
     }
 
 }

+ 2 - 0
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/FunctionInfo.java

@@ -21,4 +21,6 @@ public @interface FunctionInfo {
     String[] returnType();
 
     String description() default "";
+
+    boolean isAggregation() default false;
 }

+ 4 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Avg.java

@@ -8,6 +8,8 @@
 package org.elasticsearch.xpack.esql.expression.function.aggregate;
 
 import org.elasticsearch.xpack.esql.expression.SurrogateExpression;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.expression.predicate.operator.arithmetic.Div;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.function.aggregate.AggregateFunction;
@@ -23,7 +25,8 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric;
 
 public class Avg extends AggregateFunction implements SurrogateExpression {
 
-    public Avg(Source source, Expression field) {
+    @FunctionInfo(returnType = "double", description = "The average of a numeric field.", isAggregation = true)
+    public Avg(Source source, @Param(name = "field", type = { "double", "integer", "long", "unsigned_long" }) Expression field) {
         super(source, field);
     }
 

+ 24 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Count.java

@@ -10,6 +10,8 @@ package org.elasticsearch.xpack.esql.expression.function.aggregate;
 import org.elasticsearch.compute.aggregation.AggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.CountAggregatorFunction;
 import org.elasticsearch.xpack.esql.expression.EsqlTypeResolutions;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.planner.ToAggregator;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.Nullability;
@@ -26,7 +28,28 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal
 
 public class Count extends AggregateFunction implements EnclosedAgg, ToAggregator {
 
-    public Count(Source source, Expression field) {
+    @FunctionInfo(returnType = "long", description = "Returns the total number (count) of input values.", isAggregation = true)
+    public Count(
+        Source source,
+        @Param(
+            optional = true,
+            name = "field",
+            type = {
+                "boolean",
+                "cartesian_point",
+                "date",
+                "double",
+                "geo_point",
+                "integer",
+                "ip",
+                "keyword",
+                "long",
+                "text",
+                "unsigned_long",
+                "version" },
+            description = "Column or literal for which to count the number of values."
+        ) Expression field
+    ) {
         super(source, field);
     }
 

+ 24 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/CountDistinct.java

@@ -15,6 +15,8 @@ import org.elasticsearch.compute.aggregation.CountDistinctIntAggregatorFunctionS
 import org.elasticsearch.compute.aggregation.CountDistinctLongAggregatorFunctionSupplier;
 import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
 import org.elasticsearch.xpack.esql.expression.EsqlTypeResolutions;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.planner.ToAggregator;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.function.OptionalArgument;
@@ -35,7 +37,28 @@ public class CountDistinct extends AggregateFunction implements OptionalArgument
     private static final int DEFAULT_PRECISION = 3000;
     private final Expression precision;
 
-    public CountDistinct(Source source, Expression field, Expression precision) {
+    @FunctionInfo(returnType = "long", description = "Returns the approximate number of distinct values.", isAggregation = true)
+    public CountDistinct(
+        Source source,
+        @Param(
+            name = "field",
+            type = {
+                "boolean",
+                "cartesian_point",
+                "date",
+                "double",
+                "geo_point",
+                "integer",
+                "ip",
+                "keyword",
+                "long",
+                "text",
+                "unsigned_long",
+                "version" },
+            description = "Column or literal for which to count the number of distinct values."
+        ) Expression field,
+        @Param(optional = true, name = "precision", type = { "integer" }) Expression precision
+    ) {
         super(source, field, precision != null ? List.of(precision) : List.of());
         this.precision = precision;
     }

+ 8 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Max.java

@@ -11,6 +11,8 @@ import org.elasticsearch.compute.aggregation.AggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.MaxDoubleAggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.MaxIntAggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.MaxLongAggregatorFunctionSupplier;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.tree.NodeInfo;
 import org.elasticsearch.xpack.ql.tree.Source;
@@ -20,7 +22,12 @@ import java.util.List;
 
 public class Max extends NumericAggregate {
 
-    public Max(Source source, Expression field) {
+    @FunctionInfo(
+        returnType = { "double", "integer", "long", "unsigned_long" },
+        description = "The maximum value of a numeric field.",
+        isAggregation = true
+    )
+    public Max(Source source, @Param(name = "field", type = { "double", "integer", "long", "unsigned_long" }) Expression field) {
         super(source, field);
     }
 

+ 8 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Median.java

@@ -9,6 +9,8 @@ package org.elasticsearch.xpack.esql.expression.function.aggregate;
 
 import org.elasticsearch.compute.aggregation.QuantileStates;
 import org.elasticsearch.xpack.esql.expression.SurrogateExpression;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.Literal;
 import org.elasticsearch.xpack.ql.expression.function.aggregate.AggregateFunction;
@@ -24,7 +26,12 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric;
 
 public class Median extends AggregateFunction implements SurrogateExpression {
     // TODO: Add the compression parameter
-    public Median(Source source, Expression field) {
+    @FunctionInfo(
+        returnType = { "double", "integer", "long", "unsigned_long" },
+        description = "The value that is greater than half of all values and less than half of all values.",
+        isAggregation = true
+    )
+    public Median(Source source, @Param(name = "field", type = { "double", "integer", "long", "unsigned_long" }) Expression field) {
         super(source, field);
     }
 

+ 11 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/MedianAbsoluteDeviation.java

@@ -11,6 +11,8 @@ import org.elasticsearch.compute.aggregation.AggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.MedianAbsoluteDeviationDoubleAggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.MedianAbsoluteDeviationIntAggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.MedianAbsoluteDeviationLongAggregatorFunctionSupplier;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.tree.NodeInfo;
 import org.elasticsearch.xpack.ql.tree.Source;
@@ -20,7 +22,15 @@ import java.util.List;
 public class MedianAbsoluteDeviation extends NumericAggregate {
 
     // TODO: Add parameter
-    public MedianAbsoluteDeviation(Source source, Expression field) {
+    @FunctionInfo(
+        returnType = { "double", "integer", "long", "unsigned_long" },
+        description = "The median absolute deviation, a measure of variability.",
+        isAggregation = true
+    )
+    public MedianAbsoluteDeviation(
+        Source source,
+        @Param(name = "field", type = { "double", "integer", "long", "unsigned_long" }) Expression field
+    ) {
         super(source, field);
     }
 

+ 8 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Min.java

@@ -11,6 +11,8 @@ import org.elasticsearch.compute.aggregation.AggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.MinDoubleAggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.MinIntAggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.MinLongAggregatorFunctionSupplier;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.tree.NodeInfo;
 import org.elasticsearch.xpack.ql.tree.Source;
@@ -20,7 +22,12 @@ import java.util.List;
 
 public class Min extends NumericAggregate {
 
-    public Min(Source source, Expression field) {
+    @FunctionInfo(
+        returnType = { "double", "integer", "long", "unsigned_long" },
+        description = "The minimum value of a numeric field.",
+        isAggregation = true
+    )
+    public Min(Source source, @Param(name = "field", type = { "double", "integer", "long", "unsigned_long" }) Expression field) {
         super(source, field);
     }
 

+ 12 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Percentile.java

@@ -11,6 +11,8 @@ import org.elasticsearch.compute.aggregation.AggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.PercentileDoubleAggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.PercentileIntAggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.PercentileLongAggregatorFunctionSupplier;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.tree.NodeInfo;
 import org.elasticsearch.xpack.ql.tree.Source;
@@ -25,7 +27,16 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric;
 public class Percentile extends NumericAggregate {
     private final Expression percentile;
 
-    public Percentile(Source source, Expression field, Expression percentile) {
+    @FunctionInfo(
+        returnType = { "double", "integer", "long", "unsigned_long" },
+        description = "The value at which a certain percentage of observed values occur.",
+        isAggregation = true
+    )
+    public Percentile(
+        Source source,
+        @Param(name = "field", type = { "double", "integer", "long", "unsigned_long" }) Expression field,
+        @Param(name = "percentile", type = { "double", "integer", "long" }) Expression percentile
+    ) {
         super(source, field, List.of(percentile));
         this.percentile = percentile;
     }

+ 4 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Sum.java

@@ -10,6 +10,8 @@ import org.elasticsearch.compute.aggregation.AggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.SumDoubleAggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.SumIntAggregatorFunctionSupplier;
 import org.elasticsearch.compute.aggregation.SumLongAggregatorFunctionSupplier;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.tree.NodeInfo;
 import org.elasticsearch.xpack.ql.tree.Source;
@@ -26,7 +28,8 @@ import static org.elasticsearch.xpack.ql.type.DataTypes.UNSIGNED_LONG;
  */
 public class Sum extends NumericAggregate {
 
-    public Sum(Source source, Expression field) {
+    @FunctionInfo(returnType = "long", description = "The sum of a numeric field.", isAggregation = true)
+    public Sum(Source source, @Param(name = "field", type = { "double", "integer", "long", "unsigned_long" }) Expression field) {
         super(source, field);
     }
 

+ 40 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Case.java

@@ -17,6 +17,8 @@ import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.core.Releasable;
 import org.elasticsearch.core.Releasables;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.planner.PlannerUtils;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.Literal;
@@ -44,7 +46,44 @@ public final class Case extends ScalarFunction implements EvaluatorMapper {
     private final Expression elseValue;
     private DataType dataType;
 
-    public Case(Source source, Expression first, List<Expression> rest) {
+    @FunctionInfo(
+        returnType = {
+            "boolean",
+            "cartesian_point",
+            "date",
+            "double",
+            "geo_point",
+            "integer",
+            "ip",
+            "keyword",
+            "long",
+            "text",
+            "unsigned_long",
+            "version" },
+        description = """
+            Accepts pairs of conditions and values.
+            The function returns the value that belongs to the first condition that evaluates to true."""
+    )
+    public Case(
+        Source source,
+        @Param(name = "condition", type = { "boolean" }) Expression first,
+        @Param(
+            name = "rest",
+            type = {
+                "boolean",
+                "cartesian_point",
+                "date",
+                "double",
+                "geo_point",
+                "integer",
+                "ip",
+                "keyword",
+                "long",
+                "text",
+                "unsigned_long",
+                "version" }
+        ) List<Expression> rest
+    ) {
         super(source, Stream.concat(Stream.of(first), rest.stream()).toList());
         int conditionCount = children().size() / 2;
         conditions = new ArrayList<>(conditionCount);

+ 5 - 0
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Greatest.java

@@ -12,6 +12,7 @@ import org.elasticsearch.compute.ann.Evaluator;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
 import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.MvMax;
 import org.elasticsearch.xpack.ql.expression.Expression;
@@ -37,6 +38,10 @@ import static org.elasticsearch.xpack.ql.type.DataTypes.NULL;
 public class Greatest extends ScalarFunction implements EvaluatorMapper, OptionalArgument {
     private DataType dataType;
 
+    @FunctionInfo(
+        returnType = { "integer", "long", "double", "boolean", "keyword", "text", "ip", "version" },
+        description = "Returns the maximum value from many columns."
+    )
     public Greatest(
         Source source,
         @Param(name = "first", type = { "integer", "long", "double", "boolean", "keyword", "text", "ip", "version" }) Expression first,

+ 5 - 0
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Least.java

@@ -12,6 +12,7 @@ import org.elasticsearch.compute.ann.Evaluator;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
 import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.MvMin;
 import org.elasticsearch.xpack.ql.expression.Expression;
@@ -37,6 +38,10 @@ import static org.elasticsearch.xpack.ql.type.DataTypes.NULL;
 public class Least extends ScalarFunction implements EvaluatorMapper, OptionalArgument {
     private DataType dataType;
 
+    @FunctionInfo(
+        returnType = { "integer", "long", "double", "boolean", "keyword", "text", "ip", "version" },
+        description = "Returns the minimum value from many columns."
+    )
     public Least(
         Source source,
         @Param(name = "first", type = { "integer", "long", "double", "boolean", "keyword", "text", "ip", "version" }) Expression first,

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToBoolean.java

@@ -41,7 +41,7 @@ public class ToBoolean extends AbstractConvertFunction {
         Map.entry(INTEGER, ToBooleanFromIntEvaluator.Factory::new)
     );
 
-    @FunctionInfo(returnType = "boolean")
+    @FunctionInfo(returnType = "boolean", description = "Converts an input value to a boolean value.")
     public ToBoolean(
         Source source,
         @Param(name = "v", type = { "boolean", "keyword", "text", "double", "long", "unsigned_long", "integer" }) Expression field

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToCartesianPoint.java

@@ -32,7 +32,7 @@ public class ToCartesianPoint extends AbstractConvertFunction {
         Map.entry(TEXT, ToCartesianPointFromStringEvaluator.Factory::new)
     );
 
-    @FunctionInfo(returnType = "cartesian_point")
+    @FunctionInfo(returnType = "cartesian_point", description = "Converts an input value to a point value.")
     public ToCartesianPoint(Source source, @Param(name = "v", type = { "cartesian_point", "keyword", "text" }) Expression field) {
         super(source, field);
     }

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDatetime.java

@@ -40,7 +40,7 @@ public class ToDatetime extends AbstractConvertFunction {
         Map.entry(INTEGER, ToLongFromIntEvaluator.Factory::new) // CastIntToLongEvaluator would be a candidate, but not MV'd
     );
 
-    @FunctionInfo(returnType = "date")
+    @FunctionInfo(returnType = "date", description = "Converts an input value to a date value.")
     public ToDatetime(
         Source source,
         @Param(name = "v", type = { "date", "keyword", "text", "double", "long", "unsigned_long", "integer" }) Expression field

+ 2 - 2
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDegrees.java

@@ -40,8 +40,8 @@ public class ToDegrees extends AbstractConvertFunction implements EvaluatorMappe
         )
     );
 
-    @FunctionInfo(returnType = "double")
-    public ToDegrees(Source source, @Param(name = "v", type = { "double", "long", "unsigned_long", "integer" }) Expression field) {
+    @FunctionInfo(returnType = "double", description = "Converts a number in radians to degrees.")
+    public ToDegrees(Source source, @Param(name = "v", type = { "double", "integer", "long", "unsigned_long" }) Expression field) {
         super(source, field);
     }
 

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDouble.java

@@ -42,7 +42,7 @@ public class ToDouble extends AbstractConvertFunction {
         Map.entry(INTEGER, ToDoubleFromIntEvaluator.Factory::new) // CastIntToDoubleEvaluator would be a candidate, but not MV'd
     );
 
-    @FunctionInfo(returnType = "double")
+    @FunctionInfo(returnType = "double", description = "Converts an input value to a double value.")
     public ToDouble(
         Source source,
         @Param(name = "v", type = { "boolean", "date", "keyword", "text", "double", "long", "unsigned_long", "integer" }) Expression field

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToGeoPoint.java

@@ -32,7 +32,7 @@ public class ToGeoPoint extends AbstractConvertFunction {
         Map.entry(TEXT, ToGeoPointFromStringEvaluator.Factory::new)
     );
 
-    @FunctionInfo(returnType = "geo_point")
+    @FunctionInfo(returnType = "geo_point", description = "Converts an input value to a geo_point value.")
     public ToGeoPoint(Source source, @Param(name = "v", type = { "geo_point", "keyword", "text" }) Expression field) {
         super(source, field);
     }

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToIP.java

@@ -32,7 +32,7 @@ public class ToIP extends AbstractConvertFunction {
         Map.entry(TEXT, ToIPFromStringEvaluator.Factory::new)
     );
 
-    @FunctionInfo(returnType = "ip")
+    @FunctionInfo(returnType = "ip", description = "Converts an input string to an IP value.")
     public ToIP(Source source, @Param(name = "v", type = { "ip", "keyword", "text" }) Expression field) {
         super(source, field);
     }

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToInteger.java

@@ -44,7 +44,7 @@ public class ToInteger extends AbstractConvertFunction {
         Map.entry(LONG, ToIntegerFromLongEvaluator.Factory::new)
     );
 
-    @FunctionInfo(returnType = "integer")
+    @FunctionInfo(returnType = "integer", description = "Converts an input value to an integer value.")
     public ToInteger(
         Source source,
         @Param(name = "v", type = { "boolean", "date", "keyword", "text", "double", "long", "unsigned_long", "integer" }) Expression field

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToLong.java

@@ -51,7 +51,7 @@ public class ToLong extends AbstractConvertFunction {
         Map.entry(INTEGER, ToLongFromIntEvaluator.Factory::new) // CastIntToLongEvaluator would be a candidate, but not MV'd
     );
 
-    @FunctionInfo(returnType = "long")
+    @FunctionInfo(returnType = "long", description = "Converts an input value to a long value.")
     public ToLong(
         Source source,
         @Param(

+ 2 - 2
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToRadians.java

@@ -39,8 +39,8 @@ public class ToRadians extends AbstractConvertFunction implements EvaluatorMappe
         )
     );
 
-    @FunctionInfo(returnType = "double")
-    public ToRadians(Source source, @Param(name = "v", type = { "double", "long", "unsigned_long", "integer" }) Expression field) {
+    @FunctionInfo(returnType = "double", description = "Converts a number in degrees to radians.")
+    public ToRadians(Source source, @Param(name = "v", type = { "double", "integer", "long", "unsigned_long" }) Expression field) {
         super(source, field);
     }
 

+ 8 - 8
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToString.java

@@ -56,24 +56,24 @@ public class ToString extends AbstractConvertFunction implements EvaluatorMapper
         Map.entry(CARTESIAN_POINT, ToStringFromCartesianPointEvaluator.Factory::new)
     );
 
-    @FunctionInfo(returnType = "keyword")
+    @FunctionInfo(returnType = "keyword", description = "Converts a field into a string.")
     public ToString(
         Source source,
         @Param(
             name = "v",
             type = {
-                "unsigned_long",
-                "date",
                 "boolean",
+                "cartesian_point",
+                "date",
                 "double",
-                "ip",
-                "text",
+                "geo_point",
                 "integer",
+                "ip",
                 "keyword",
-                "version",
                 "long",
-                "geo_point",
-                "cartesian_point" }
+                "text",
+                "unsigned_long",
+                "version" }
         ) Expression v
     ) {
         super(source, v);

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToUnsignedLong.java

@@ -46,7 +46,7 @@ public class ToUnsignedLong extends AbstractConvertFunction {
         Map.entry(INTEGER, ToUnsignedLongFromIntEvaluator.Factory::new)
     );
 
-    @FunctionInfo(returnType = "unsigned_long")
+    @FunctionInfo(returnType = "unsigned_long", description = "Converts an input value to an unsigned long value.")
     public ToUnsignedLong(
         Source source,
         @Param(name = "v", type = { "boolean", "date", "keyword", "text", "double", "long", "unsigned_long", "integer" }) Expression field

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToVersion.java

@@ -32,7 +32,7 @@ public class ToVersion extends AbstractConvertFunction {
         Map.entry(TEXT, ToVersionFromStringEvaluator.Factory::new)
     );
 
-    @FunctionInfo(returnType = "version")
+    @FunctionInfo(returnType = "version", description = "Converts an input string to a version value.")
     public ToVersion(Source source, @Param(name = "v", type = { "keyword", "text", "version" }) Expression v) {
         super(source, v);
     }

+ 17 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtract.java

@@ -13,6 +13,8 @@ import org.elasticsearch.compute.ann.Evaluator;
 import org.elasticsearch.compute.ann.Fixed;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.ql.InvalidArgumentException;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.TypeResolutions;
@@ -38,7 +40,21 @@ public class DateExtract extends ConfigurationFunction implements EvaluatorMappe
 
     private ChronoField chronoField;
 
-    public DateExtract(Source source, Expression chronoFieldExp, Expression field, Configuration configuration) {
+    @FunctionInfo(returnType = "long", description = "Extracts parts of a date, like year, month, day, hour.")
+    public DateExtract(
+        Source source,
+        // Need to replace the commas in the description here with semi-colon as there's a bug in the CSV parser
+        // used in the CSVTests and fixing it is not trivial
+        @Param(name = "date_part", type = { "keyword" }, description = """
+            Part of the date to extract.
+            Can be: aligned_day_of_week_in_month; aligned_day_of_week_in_year; aligned_week_of_month;
+            aligned_week_of_year; ampm_of_day; clock_hour_of_ampm; clock_hour_of_day; day_of_month; day_of_week;
+            day_of_year; epoch_day; era; hour_of_ampm; hour_of_day; instant_seconds; micro_of_day; micro_of_second;
+            milli_of_day; milli_of_second; minute_of_day; minute_of_hour; month_of_year; nano_of_day; nano_of_second;
+            offset_seconds; proleptic_month; second_of_day; second_of_minute; year; or year_of_era.""") Expression chronoFieldExp,
+        @Param(name = "field", type = "date", description = "Date expression") Expression field,
+        Configuration configuration
+    ) {
         super(source, List.of(chronoFieldExp, field), configuration);
     }
 

+ 12 - 4
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormat.java

@@ -13,6 +13,8 @@ import org.elasticsearch.compute.ann.Evaluator;
 import org.elasticsearch.compute.ann.Fixed;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.session.EsqlConfiguration;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.function.OptionalArgument;
@@ -39,10 +41,16 @@ public class DateFormat extends ConfigurationFunction implements OptionalArgumen
     private final Expression field;
     private final Expression format;
 
-    public DateFormat(Source source, Expression first, Expression second, Configuration configuration) {
-        super(source, second != null ? List.of(first, second) : List.of(first), configuration);
-        this.field = second != null ? second : first;
-        this.format = second != null ? first : null;
+    @FunctionInfo(returnType = "keyword", description = "Returns a string representation of a date, in the provided format.")
+    public DateFormat(
+        Source source,
+        @Param(optional = true, name = "format", type = { "keyword" }, description = "A valid date pattern") Expression format,
+        @Param(name = "date", type = { "date" }, description = "Date expression") Expression date,
+        Configuration configuration
+    ) {
+        super(source, date != null ? List.of(format, date) : List.of(format), configuration);
+        this.field = date != null ? date : format;
+        this.format = date != null ? format : null;
     }
 
     @Override

+ 14 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateTrunc.java

@@ -13,6 +13,8 @@ import org.elasticsearch.compute.ann.Fixed;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.core.TimeValue;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.type.EsqlDataTypes;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.function.scalar.BinaryScalarFunction;
@@ -32,7 +34,18 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType;
 
 public class DateTrunc extends BinaryDateTimeFunction implements EvaluatorMapper {
 
-    public DateTrunc(Source source, Expression interval, Expression field) {
+    @FunctionInfo(returnType = "date", description = "Rounds down a date to the closest interval.")
+    public DateTrunc(
+        Source source,
+        // Need to replace the commas in the description here with semi-colon as there's a bug in the CSV parser
+        // used in the CSVTests and fixing it is not trivial
+        @Param(
+            name = "interval",
+            type = { "keyword" },
+            description = "Interval; expressed using the timespan literal syntax."
+        ) Expression interval,
+        @Param(name = "date", type = { "date" }, description = "Date expression") Expression field
+    ) {
         super(source, interval, field);
     }
 

+ 2 - 0
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/Now.java

@@ -11,6 +11,7 @@ import org.elasticsearch.compute.ann.Evaluator;
 import org.elasticsearch.compute.ann.Fixed;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.function.scalar.ConfigurationFunction;
 import org.elasticsearch.xpack.ql.expression.gen.script.ScriptTemplate;
@@ -27,6 +28,7 @@ public class Now extends ConfigurationFunction implements EvaluatorMapper {
 
     private final long now;
 
+    @FunctionInfo(returnType = "date", description = "Returns current date and time.")
     public Now(Source source, Configuration configuration) {
         super(source, List.of(), configuration);
         this.now = configuration.now() == null ? System.currentTimeMillis() : configuration.now().toInstant().toEpochMilli();

+ 8 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/ip/CIDRMatch.java

@@ -13,6 +13,8 @@ import org.elasticsearch.compute.ann.Evaluator;
 import org.elasticsearch.compute.operator.EvalOperator;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.function.scalar.ScalarFunction;
 import org.elasticsearch.xpack.ql.expression.gen.script.ScriptTemplate;
@@ -48,7 +50,12 @@ public class CIDRMatch extends ScalarFunction implements EvaluatorMapper {
     private final Expression ipField;
     private final List<Expression> matches;
 
-    public CIDRMatch(Source source, Expression ipField, List<Expression> matches) {
+    @FunctionInfo(returnType = "boolean", description = "Returns true if the provided IP is contained in one of the provided CIDR blocks.")
+    public CIDRMatch(
+        Source source,
+        @Param(name = "ip", type = { "ip" }) Expression ipField,
+        @Param(name = "blockX", type = { "keyword" }, description = "CIDR block to test the IP against.") List<Expression> matches
+    ) {
         super(source, CollectionUtils.combine(singletonList(ipField), matches));
         this.ipField = ipField;
         this.matches = matches;

+ 2 - 2
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Abs.java

@@ -23,8 +23,8 @@ import java.util.List;
 import java.util.function.Function;
 
 public class Abs extends UnaryScalarFunction implements EvaluatorMapper {
-    @FunctionInfo(returnType = { "integer", "long", "double", "unsigned_long" })
-    public Abs(Source source, @Param(name = "n", type = { "integer", "long", "double", "unsigned_long" }) Expression n) {
+    @FunctionInfo(returnType = { "double", "integer", "long", "unsigned_long" }, description = "Returns the absolute value.")
+    public Abs(Source source, @Param(name = "n", type = { "double", "integer", "long", "unsigned_long" }) Expression n) {
         super(source, n);
     }
 

+ 2 - 2
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Acos.java

@@ -21,8 +21,8 @@ import java.util.List;
  * Inverse cosine trigonometric function.
  */
 public class Acos extends AbstractTrigonometricFunction {
-    @FunctionInfo(returnType = "double")
-    public Acos(Source source, @Param(name = "n", type = { "integer", "long", "double", "unsigned_long" }) Expression n) {
+    @FunctionInfo(returnType = "double", description = "The arccosine of an angle, expressed in radians.")
+    public Acos(Source source, @Param(name = "n", type = { "double", "integer", "long", "unsigned_long" }) Expression n) {
         super(source, n);
     }
 

+ 2 - 2
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Asin.java

@@ -21,8 +21,8 @@ import java.util.List;
  * Inverse cosine trigonometric function.
  */
 public class Asin extends AbstractTrigonometricFunction {
-    @FunctionInfo(returnType = "double")
-    public Asin(Source source, @Param(name = "n", type = { "integer", "long", "double", "unsigned_long" }) Expression n) {
+    @FunctionInfo(returnType = "double", description = "Inverse sine trigonometric function.")
+    public Asin(Source source, @Param(name = "n", type = { "double", "integer", "long", "unsigned_long" }) Expression n) {
         super(source, n);
     }
 

+ 2 - 2
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan.java

@@ -21,8 +21,8 @@ import java.util.List;
  * Inverse cosine trigonometric function.
  */
 public class Atan extends AbstractTrigonometricFunction {
-    @FunctionInfo(returnType = "double")
-    public Atan(Source source, @Param(name = "n", type = { "integer", "long", "double", "unsigned_long" }) Expression n) {
+    @FunctionInfo(returnType = "double", description = "Inverse tangent trigonometric function.")
+    public Atan(Source source, @Param(name = "n", type = { "double", "integer", "long", "unsigned_long" }) Expression n) {
         super(source, n);
     }
 

+ 6 - 3
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan2.java

@@ -34,11 +34,14 @@ public class Atan2 extends ScalarFunction implements EvaluatorMapper {
     private final Expression y;
     private final Expression x;
 
-    @FunctionInfo(returnType = "double")
+    @FunctionInfo(
+        returnType = "double",
+        description = "The angle between the positive x-axis and the ray from the origin to the point (x , y) in the Cartesian plane."
+    )
     public Atan2(
         Source source,
-        @Param(name = "y", type = { "integer", "long", "double", "unsigned_long" }) Expression y,
-        @Param(name = "x", type = { "integer", "long", "double", "unsigned_long" }) Expression x
+        @Param(name = "y", type = { "double", "integer", "long", "unsigned_long" }) Expression y,
+        @Param(name = "x", type = { "double", "integer", "long", "unsigned_long" }) Expression x
     ) {
         super(source, List.of(y, x));
         this.y = y;

+ 3 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucket.java

@@ -83,7 +83,9 @@ public class AutoBucket extends ScalarFunction implements EvaluatorMapper {
     private final Expression from;
     private final Expression to;
 
-    @FunctionInfo(returnType = { "double", "date" })
+    @FunctionInfo(returnType = { "double", "date" }, description = """
+        Creates human-friendly buckets and returns a datetime value
+        for each row that corresponds to the resulting bucket the row falls into.""")
     public AutoBucket(
         Source source,
         @Param(name = "field", type = { "integer", "long", "double", "date" }) Expression field,

+ 3 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Ceil.java

@@ -10,6 +10,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math;
 import org.elasticsearch.compute.ann.Evaluator;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
 import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction;
 import org.elasticsearch.xpack.ql.expression.Expression;
@@ -30,7 +31,8 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric;
  * </p>
  */
 public class Ceil extends UnaryScalarFunction implements EvaluatorMapper {
-    public Ceil(Source source, @Param(name = "n", type = { "integer", "long", "double", "unsigned_long" }) Expression n) {
+    @FunctionInfo(returnType = { "double", "integer", "long", "unsigned_long" }, description = "Round a number up to the nearest integer.")
+    public Ceil(Source source, @Param(name = "n", type = { "double", "integer", "long", "unsigned_long" }) Expression n) {
         super(source, n);
     }
 

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cos.java

@@ -24,7 +24,7 @@ public class Cos extends AbstractTrigonometricFunction {
     @FunctionInfo(returnType = "double", description = "Returns the trigonometric cosine of an angle")
     public Cos(
         Source source,
-        @Param(name = "n", type = { "integer", "long", "double", "unsigned_long" }, description = "An angle, in radians") Expression n
+        @Param(name = "n", type = { "double", "integer", "long", "unsigned_long" }, description = "An angle, in radians") Expression n
     ) {
         super(source, n);
     }

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cosh.java

@@ -26,7 +26,7 @@ public class Cosh extends AbstractTrigonometricFunction {
         Source source,
         @Param(
             name = "n",
-            type = { "integer", "long", "double", "unsigned_long" },
+            type = { "double", "integer", "long", "unsigned_long" },
             description = "The number who's hyperbolic cosine is to be returned"
         ) Expression n
     ) {

+ 2 - 0
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/E.java

@@ -7,6 +7,7 @@
 
 package org.elasticsearch.xpack.esql.expression.function.scalar.math;
 
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.tree.Source;
 
@@ -16,6 +17,7 @@ import java.util.List;
  * Function that emits Euler's number.
  */
 public class E extends DoubleConstantFunction {
+    @FunctionInfo(returnType = "double", description = "Euler’s number.")
     public E(Source source) {
         super(source);
     }

+ 6 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Floor.java

@@ -10,6 +10,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math;
 import org.elasticsearch.compute.ann.Evaluator;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
 import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction;
 import org.elasticsearch.xpack.ql.expression.Expression;
@@ -30,7 +31,11 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric;
  * </p>
  */
 public class Floor extends UnaryScalarFunction implements EvaluatorMapper {
-    public Floor(Source source, @Param(name = "n", type = { "integer", "long", "double", "unsigned_long" }) Expression n) {
+    @FunctionInfo(
+        returnType = { "double", "integer", "long", "unsigned_long" },
+        description = "Round a number down to the nearest integer."
+    )
+    public Floor(Source source, @Param(name = "n", type = { "double", "integer", "long", "unsigned_long" }) Expression n) {
         super(source, n);
     }
 

+ 3 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10.java

@@ -11,6 +11,7 @@ import org.elasticsearch.compute.ann.Evaluator;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
 import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction;
 import org.elasticsearch.xpack.ql.expression.Expression;
@@ -27,7 +28,8 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal
 import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric;
 
 public class Log10 extends UnaryScalarFunction implements EvaluatorMapper {
-    public Log10(Source source, @Param(name = "n", type = { "integer", "long", "double", "unsigned_long" }) Expression n) {
+    @FunctionInfo(returnType = "double", description = "Returns the log base 10.")
+    public Log10(Source source, @Param(name = "n", type = { "double", "integer", "long", "unsigned_long" }) Expression n) {
         super(source, n);
     }
 

+ 3 - 0
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Pi.java

@@ -7,6 +7,7 @@
 
 package org.elasticsearch.xpack.esql.expression.function.scalar.math;
 
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.tree.Source;
 
@@ -16,6 +17,8 @@ import java.util.List;
  * Function that emits pi.
  */
 public class Pi extends DoubleConstantFunction {
+
+    @FunctionInfo(returnType = "double", description = "The ratio of a circle’s circumference to its diameter.")
     public Pi(Source source) {
         super(source);
     }

+ 4 - 2
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Pow.java

@@ -10,6 +10,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math;
 import org.elasticsearch.compute.ann.Evaluator;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
 import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.function.OptionalArgument;
@@ -35,10 +36,11 @@ public class Pow extends ScalarFunction implements OptionalArgument, EvaluatorMa
     private final Expression base, exponent;
     private final DataType dataType;
 
+    @FunctionInfo(returnType = "double", description = "Returns the value of a base raised to the power of an exponent.")
     public Pow(
         Source source,
-        @Param(name = "base", type = { "integer", "unsigned_long", "long", "double" }) Expression base,
-        @Param(name = "exponent", type = { "integer", "unsigned_long", "long", "double" }) Expression exponent
+        @Param(name = "base", type = { "double", "integer", "long", "unsigned_long" }) Expression base,
+        @Param(name = "exponent", type = { "double", "integer", "long", "unsigned_long" }) Expression exponent
     ) {
         super(source, Arrays.asList(base, exponent));
         this.base = base;

+ 14 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Round.java

@@ -12,6 +12,8 @@ import org.elasticsearch.compute.ann.Evaluator;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.function.OptionalArgument;
 import org.elasticsearch.xpack.ql.expression.function.scalar.ScalarFunction;
@@ -43,7 +45,18 @@ public class Round extends ScalarFunction implements OptionalArgument, Evaluator
 
     private final Expression field, decimals;
 
-    public Round(Source source, Expression field, Expression decimals) {
+    // @TODO: add support for "integer", "long", "unsigned_long" once tests are fixed
+    @FunctionInfo(returnType = "double", description = "Rounds a number to the closest number with the specified number of digits.")
+    public Round(
+        Source source,
+        @Param(name = "value", type = "double", description = "The numeric value to round") Expression field,
+        @Param(
+            optional = true,
+            name = "decimals",
+            type = { "integer" },
+            description = "The number of decimal places to round to. Defaults to 0."
+        ) Expression decimals
+    ) {
         super(source, decimals != null ? Arrays.asList(field, decimals) : Arrays.asList(field));
         this.field = field;
         this.decimals = decimals;

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sin.java

@@ -25,7 +25,7 @@ public class Sin extends AbstractTrigonometricFunction {
     @FunctionInfo(returnType = "double", description = "Returns the trigonometric sine of an angle")
     public Sin(
         Source source,
-        @Param(name = "n", type = { "integer", "long", "double", "unsigned_long" }, description = "An angle, in radians") Expression n
+        @Param(name = "n", type = { "double", "integer", "long", "unsigned_long" }, description = "An angle, in radians") Expression n
     ) {
         super(source, n);
     }

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sinh.java

@@ -26,7 +26,7 @@ public class Sinh extends AbstractTrigonometricFunction {
         Source source,
         @Param(
             name = "n",
-            type = { "integer", "long", "double", "unsigned_long" },
+            type = { "double", "integer", "long", "unsigned_long" },
             description = "The number to return the hyperbolic sine of"
         ) Expression n
     ) {

+ 3 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sqrt.java

@@ -11,6 +11,7 @@ import org.elasticsearch.compute.ann.Evaluator;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
 import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction;
 import org.elasticsearch.xpack.ql.expression.Expression;
@@ -27,7 +28,8 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal
 import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric;
 
 public class Sqrt extends UnaryScalarFunction implements EvaluatorMapper {
-    public Sqrt(Source source, @Param(name = "n", type = { "integer", "long", "double", "unsigned_long" }) Expression n) {
+    @FunctionInfo(returnType = "double", description = "Returns the square root of a number.")
+    public Sqrt(Source source, @Param(name = "n", type = { "double", "integer", "long", "unsigned_long" }) Expression n) {
         super(source, n);
     }
 

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tan.java

@@ -24,7 +24,7 @@ public class Tan extends AbstractTrigonometricFunction {
     @FunctionInfo(returnType = "double", description = "Returns the trigonometric tangent of an angle")
     public Tan(
         Source source,
-        @Param(name = "n", type = { "integer", "long", "double", "unsigned_long" }, description = "An angle, in radians") Expression n
+        @Param(name = "n", type = { "double", "integer", "long", "unsigned_long" }, description = "An angle, in radians") Expression n
     ) {
         super(source, n);
     }

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tanh.java

@@ -26,7 +26,7 @@ public class Tanh extends AbstractTrigonometricFunction {
         Source source,
         @Param(
             name = "n",
-            type = { "integer", "long", "double", "unsigned_long" },
+            type = { "double", "integer", "long", "unsigned_long" },
             description = "The number to return the hyperbolic tangent of"
         ) Expression n
     ) {

+ 2 - 0
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tau.java

@@ -7,6 +7,7 @@
 
 package org.elasticsearch.xpack.esql.expression.function.scalar.math;
 
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.tree.Source;
 
@@ -18,6 +19,7 @@ import java.util.List;
 public class Tau extends DoubleConstantFunction {
     public static final double TAU = Math.PI * 2;
 
+    @FunctionInfo(returnType = "double", description = "The ratio of a circle’s circumference to its radius.")
     public Tau(Source source) {
         super(source);
     }

+ 7 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvg.java

@@ -12,6 +12,8 @@ import org.elasticsearch.compute.operator.EvalOperator;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.search.aggregations.metrics.CompensatedSum;
 import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.planner.PlannerUtils;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.tree.NodeInfo;
@@ -29,7 +31,11 @@ import static org.elasticsearch.xpack.ql.util.NumericUtils.unsignedLongToDouble;
  * Reduce a multivalued field to a single valued field containing the average value.
  */
 public class MvAvg extends AbstractMultivalueFunction {
-    public MvAvg(Source source, Expression field) {
+    @FunctionInfo(
+        returnType = "double",
+        description = "Converts a multivalued field into a single valued field containing the average of all of the values."
+    )
+    public MvAvg(Source source, @Param(name = "field", type = { "double", "integer", "long", "unsigned_long" }) Expression field) {
         super(source, field);
     }
 

+ 7 - 7
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvCount.java

@@ -37,18 +37,18 @@ public class MvCount extends AbstractMultivalueFunction {
         @Param(
             name = "v",
             type = {
-                "unsigned_long",
-                "date",
                 "boolean",
+                "cartesian_point",
+                "date",
                 "double",
-                "ip",
-                "text",
+                "geo_point",
                 "integer",
+                "ip",
                 "keyword",
-                "version",
                 "long",
-                "geo_point",
-                "cartesian_point" }
+                "text",
+                "unsigned_long",
+                "version" }
         ) Expression v
     ) {
         super(source, v);

+ 6 - 5
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvDedupe.java

@@ -25,13 +25,14 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType;
  * Removes duplicate values from a multivalued field.
  */
 public class MvDedupe extends AbstractMultivalueFunction {
-    @FunctionInfo(returnType = "?", description = "Remove duplicate values from a multivalued field.")
+    // @TODO: add cartesian_point, geo_point, unsigned_long
+    @FunctionInfo(
+        returnType = { "boolean", "date", "double", "integer", "ip", "keyword", "long", "text", "version" },
+        description = "Remove duplicate values from a multivalued field."
+    )
     public MvDedupe(
         Source source,
-        @Param(
-            name = "v",
-            type = { "boolean", "date", "double", "ip", "text", "integer", "keyword", "version", "long" }  // TODO add unsigned_long
-        ) Expression field
+        @Param(name = "v", type = { "boolean", "date", "double", "integer", "ip", "keyword", "long", "text", "version" }) Expression field
     ) {
         super(source, field);
     }

+ 23 - 8
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvFirst.java

@@ -33,24 +33,39 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType;
  * Reduce a multivalued field to a single valued field containing the minimum value.
  */
 public class MvFirst extends AbstractMultivalueFunction {
-    @FunctionInfo(returnType = "?", description = "Reduce a multivalued field to a single valued field containing the first value.")
+    @FunctionInfo(
+        returnType = {
+            "boolean",
+            "cartesian_point",
+            "date",
+            "double",
+            "geo_point",
+            "integer",
+            "ip",
+            "keyword",
+            "long",
+            "text",
+            "unsigned_long",
+            "version" },
+        description = "Reduce a multivalued field to a single valued field containing the first value."
+    )
     public MvFirst(
         Source source,
         @Param(
             name = "v",
             type = {
-                "unsigned_long",
-                "date",
                 "boolean",
+                "cartesian_point",
+                "date",
                 "double",
-                "ip",
-                "text",
+                "geo_point",
                 "integer",
+                "ip",
                 "keyword",
-                "version",
                 "long",
-                "geo_point",
-                "cartesian_point" }
+                "text",
+                "unsigned_long",
+                "version" }
         ) Expression field
     ) {
         super(source, field);

+ 23 - 8
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvLast.java

@@ -33,24 +33,39 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType;
  * Reduce a multivalued field to a single valued field containing the minimum value.
  */
 public class MvLast extends AbstractMultivalueFunction {
-    @FunctionInfo(returnType = "?", description = "Reduce a multivalued field to a single valued field containing the last value.")
+    @FunctionInfo(
+        returnType = {
+            "boolean",
+            "cartesian_point",
+            "date",
+            "double",
+            "geo_point",
+            "integer",
+            "ip",
+            "keyword",
+            "long",
+            "text",
+            "unsigned_long",
+            "version" },
+        description = "Reduce a multivalued field to a single valued field containing the last value."
+    )
     public MvLast(
         Source source,
         @Param(
             name = "v",
             type = {
-                "unsigned_long",
-                "date",
                 "boolean",
+                "cartesian_point",
+                "date",
                 "double",
-                "ip",
-                "text",
+                "geo_point",
                 "integer",
+                "ip",
                 "keyword",
-                "version",
                 "long",
-                "geo_point",
-                "cartesian_point" }
+                "text",
+                "unsigned_long",
+                "version" }
         ) Expression field
     ) {
         super(source, field);

+ 5 - 2
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMax.java

@@ -29,12 +29,15 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType;
  * Reduce a multivalued field to a single valued field containing the maximum value.
  */
 public class MvMax extends AbstractMultivalueFunction {
-    @FunctionInfo(returnType = "?", description = "Reduce a multivalued field to a single valued field containing the maximum value.")
+    @FunctionInfo(
+        returnType = { "boolean", "date", "double", "integer", "ip", "keyword", "long", "text", "unsigned_long", "version" },
+        description = "Reduce a multivalued field to a single valued field containing the maximum value."
+    )
     public MvMax(
         Source source,
         @Param(
             name = "v",
-            type = { "unsigned_long", "date", "boolean", "double", "ip", "text", "integer", "keyword", "version", "long" }
+            type = { "boolean", "date", "double", "integer", "ip", "keyword", "long", "text", "unsigned_long", "version" }
         ) Expression v
     ) {
         super(source, v);

+ 7 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedian.java

@@ -14,6 +14,8 @@ import org.elasticsearch.compute.data.IntBlock;
 import org.elasticsearch.compute.data.LongBlock;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.planner.PlannerUtils;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.tree.NodeInfo;
@@ -33,7 +35,11 @@ import static org.elasticsearch.xpack.ql.util.NumericUtils.unsignedLongAsBigInte
  * Reduce a multivalued field to a single valued field containing the average value.
  */
 public class MvMedian extends AbstractMultivalueFunction {
-    public MvMedian(Source source, Expression field) {
+    @FunctionInfo(
+        returnType = { "double", "integer", "long", "unsigned_long" },
+        description = "Converts a multivalued field into a single valued field containing the median value."
+    )
+    public MvMedian(Source source, @Param(name = "v", type = { "double", "integer", "long", "unsigned_long" }) Expression field) {
         super(source, field);
     }
 

+ 5 - 2
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMin.java

@@ -29,12 +29,15 @@ import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType;
  * Reduce a multivalued field to a single valued field containing the minimum value.
  */
 public class MvMin extends AbstractMultivalueFunction {
-    @FunctionInfo(returnType = "?", description = "Reduce a multivalued field to a single valued field containing the minimum value.")
+    @FunctionInfo(
+        returnType = { "boolean", "date", "double", "integer", "ip", "keyword", "long", "text", "unsigned_long", "version" },
+        description = "Reduce a multivalued field to a single valued field containing the minimum value."
+    )
     public MvMin(
         Source source,
         @Param(
             name = "v",
-            type = { "unsigned_long", "date", "boolean", "double", "ip", "text", "integer", "keyword", "version", "long" }
+            type = { "boolean", "date", "double", "integer", "ip", "keyword", "long", "text", "unsigned_long", "version" }
         ) Expression field
     ) {
         super(source, field);

+ 7 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSum.java

@@ -12,6 +12,8 @@ import org.elasticsearch.compute.operator.EvalOperator;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.search.aggregations.metrics.CompensatedSum;
 import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.planner.PlannerUtils;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.tree.NodeInfo;
@@ -28,7 +30,11 @@ import static org.elasticsearch.xpack.ql.util.NumericUtils.unsignedLongAddExact;
  * Reduce a multivalued field to a single valued field containing the sum of all values.
  */
 public class MvSum extends AbstractMultivalueFunction {
-    public MvSum(Source source, Expression field) {
+    @FunctionInfo(
+        returnType = { "double", "integer", "long", "unsigned_long" },
+        description = "Converts a multivalued field into a single valued field containing the sum of all of the values."
+    )
+    public MvSum(Source source, @Param(name = "v", type = { "double", "integer", "long", "unsigned_long" }) Expression field) {
         super(source, field);
     }
 

+ 19 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/Coalesce.java

@@ -16,6 +16,8 @@ import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.core.Releasable;
 import org.elasticsearch.core.Releasables;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.esql.planner.PlannerUtils;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.Expressions;
@@ -41,7 +43,23 @@ import static org.elasticsearch.xpack.ql.type.DataTypes.NULL;
 public class Coalesce extends ScalarFunction implements EvaluatorMapper, OptionalArgument {
     private DataType dataType;
 
-    public Coalesce(Source source, Expression first, List<Expression> rest) {
+    @FunctionInfo(
+        returnType = { "boolean", "text", "integer", "keyword", "long" },
+        description = "Returns the first of its arguments that is not null."
+    )
+    public Coalesce(
+        Source source,
+        @Param(
+            name = "expression",
+            type = { "boolean", "text", "integer", "keyword", "long" },
+            description = "Expression to evaluate"
+        ) Expression first,
+        @Param(
+            name = "expressionX",
+            type = { "boolean", "text", "integer", "keyword", "long" },
+            description = "Other expression to evaluate"
+        ) List<Expression> rest
+    ) {
         super(source, Stream.concat(Stream.of(first), rest.stream()).toList());
     }
 

+ 8 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Concat.java

@@ -14,6 +14,8 @@ import org.elasticsearch.compute.operator.BreakingBytesRefBuilder;
 import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
 import org.elasticsearch.xpack.esql.EsqlClientException;
 import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
+import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
+import org.elasticsearch.xpack.esql.expression.function.Param;
 import org.elasticsearch.xpack.ql.expression.Expression;
 import org.elasticsearch.xpack.ql.expression.Expressions;
 import org.elasticsearch.xpack.ql.expression.function.scalar.ScalarFunction;
@@ -38,7 +40,12 @@ public class Concat extends ScalarFunction implements EvaluatorMapper {
 
     static final long MAX_CONCAT_LENGTH = MB.toBytes(1);
 
-    public Concat(Source source, Expression first, List<? extends Expression> rest) {
+    @FunctionInfo(returnType = "keyword", description = "Concatenates two or more strings.")
+    public Concat(
+        Source source,
+        @Param(name = "first", type = { "keyword", "text" }) Expression first,
+        @Param(name = "rest", type = { "keyword", "text" }) List<? extends Expression> rest
+    ) {
         super(source, Stream.concat(Stream.of(first), rest.stream()).toList());
     }
 

Some files were not shown because too many files changed in this diff