mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-29 09:54:06 -04:00
Implement the use of scalar functions inside aggregate functions.
This allows for complex expressions inside aggregations, with or without
GROUBY as well as with or without a HAVING clause. e.g.:
```
SELECT MAX(CASE WHEN a IS NULL then -1 ELSE abs(a * 10) + 1 END) AS max, b
FROM test
GROUP BY b
HAVING MAX(CASE WHEN a IS NULL then -1 ELSE abs(a * 10) + 1 END) > 5
```
Scalar functions are still not allowed for `KURTOSIS` and `SKEWNESS` as
this is currently not implemented on the ElasticSearch side.
Fixes: #29980
Fixes: #36865
Fixes: #37271
(cherry picked from commit
|
||
---|---|---|
.. | ||
aggs.asciidoc | ||
conditional.asciidoc | ||
date-time.asciidoc | ||
geo.asciidoc | ||
grouping.asciidoc | ||
index.asciidoc | ||
like-rlike.asciidoc | ||
math.asciidoc | ||
operators.asciidoc | ||
search.asciidoc | ||
string.asciidoc | ||
system.asciidoc | ||
type-conversion.asciidoc |