elasticsearch/docs/reference/sql
Marios Trivyzas 506d1beea7
SQL: Implement scripting inside aggs (#55241)
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
2020-04-17 11:22:06 +02:00
..
appendix
endpoints ODBC: Document the new VarcharLimit and EarlyExecution params (#54632) 2020-04-03 14:44:25 +02:00
functions SQL: Implement scripting inside aggs (#55241) 2020-04-17 11:22:06 +02:00
language QL: constant_keyword support (#53241) 2020-03-16 15:22:42 +02:00
concepts.asciidoc
getting-started.asciidoc Remove types from BulkRequest (#46983) 2019-10-07 13:29:12 +01:00
index.asciidoc
limitations.asciidoc SQL: Implement scripting inside aggs (#55241) 2020-04-17 11:22:06 +02:00
overview.asciidoc
security.asciidoc