elasticsearch/docs/reference/esql/functions
Iván Cea Fontenla fc0313f429
ESQL: Add aggregations testing base and docs (#110042)
- Added a new `AbstractAggregationTestCase` base class for tests, that shares most of the code of function tests, adapted for aggregations. Including both testing and docs generation.
  - Reused the `AbstractFunctionTestCase` class to also let us test evaluators if the aggregation is foldable
- Added a `TopListTests` example
  - This includes the docs for Top_list _(Also added a missing include of Ip_prefix docs)_
- Adapted Kibana docs to use `type: "agg"` (@drewdaemon)

The current tests are very basic: Consume a page, generate an output,
all in Single aggregation mode (No intermediates, no grouping). More
complex testing will be added in future PRs

Initial PR of https://github.com/elastic/elasticsearch/issues/109917
2024-06-27 21:21:55 +10:00
..
description ESQL: Add aggregations testing base and docs (#110042) 2024-06-27 21:21:55 +10:00
examples ESQL: Add aggregations testing base and docs (#110042) 2024-06-27 21:21:55 +10:00
kibana ESQL: Add aggregations testing base and docs (#110042) 2024-06-27 21:21:55 +10:00
layout ESQL: Add aggregations testing base and docs (#110042) 2024-06-27 21:21:55 +10:00
parameters ESQL: Add aggregations testing base and docs (#110042) 2024-06-27 21:21:55 +10:00
signature ESQL: Add aggregations testing base and docs (#110042) 2024-06-27 21:21:55 +10:00
types ESQL: Add aggregations testing base and docs (#110042) 2024-06-27 21:21:55 +10:00
README.md
aggregation-functions.asciidoc ESQL: Add aggregations testing base and docs (#110042) 2024-06-27 21:21:55 +10:00
avg.asciidoc
binary.asciidoc
case.asciidoc
cast.asciidoc
conditional-functions-and-expressions.asciidoc
count-distinct.asciidoc
count.asciidoc
date-time-functions.asciidoc
grouping-functions.asciidoc
in.asciidoc
ip-functions.asciidoc ESQL: Add aggregations testing base and docs (#110042) 2024-06-27 21:21:55 +10:00
like.asciidoc
logical.asciidoc
math-functions.asciidoc
max.asciidoc
median-absolute-deviation.asciidoc
median.asciidoc
min.asciidoc
mv-functions.asciidoc
operators.asciidoc
percentile.asciidoc
predicates.asciidoc
rlike.asciidoc
round.asciidoc
spatial-functions.asciidoc ES|QL ST_DISTANCE Function (#108764) 2024-06-21 11:59:44 +02:00
st_centroid_agg.asciidoc
string-functions.asciidoc
sum.asciidoc
type-conversion-functions.asciidoc
unary.asciidoc
values.asciidoc

README.md

The files in these subdirectories are generated by ESQL's test suite:

  • description - description of each function scraped from @FunctionInfo#description
  • examples - examples of each function scraped from @FunctionInfo#examples
  • parameters - description of each function's parameters scraped from @Param
  • signature - railroad diagram of the syntax to invoke each function
  • types - a table of each combination of support type for each parameter. These are generated from tests.
  • layout - a fully generated description for each function
  • kibana/definition - function definitions for kibana's ESQL editor
  • kibana/docs - the inline docs for kibana

Most functions can use the generated docs generated in the layout directory. If we need something more custom for the function we can make a file in this directory that can include:: any parts of the files above.

To regenerate the files for a function run its tests using gradle:

./gradlew :x-pack:plugin:esql:test -Dtests.class='*SinTests'

To regenerate the files for all functions run all of ESQL's tests using gradle:

./gradlew :x-pack:plugin:esql:test