OpenSearch/docs/reference/sql/functions
Marios Trivyzas f958e9abdc
SQL: Implement scripting inside aggs (#55241) (#55371)
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 506d1beea7abb2b45de793bba2e349090a78f2f9)
2020-04-17 12:41:22 +02:00
..
aggs.asciidoc SQL: Implement scripting inside aggs (#55241) (#55371) 2020-04-17 12:41:22 +02:00
conditional.asciidoc SQL: document the use of a filter on _routing (#52355) 2020-02-14 19:00:26 +02:00
date-time.asciidoc SQL: Implement DATETIME_PARSE function for parsing strings (#54960) (#55035) 2020-04-10 01:16:29 +02:00
geo.asciidoc SQL: document the use of a filter on _routing (#52355) 2020-02-14 19:00:26 +02:00
grouping.asciidoc SQL: Use calendar_interval of 1d for HISTOGRAMs with 1 DAY intervals (#52749) (#52771) 2020-02-25 18:44:02 +02:00
index.asciidoc SQL: Implement DATETIME_PARSE function for parsing strings (#54960) (#55035) 2020-04-10 01:16:29 +02:00
like-rlike.asciidoc SQL: document the use of a filter on _routing (#52355) 2020-02-14 19:00:26 +02:00
math.asciidoc SQL: document the use of a filter on _routing (#52355) 2020-02-14 19:00:26 +02:00
operators.asciidoc [DOCS] Remove unneeded options from `[source,sql]` code blocks (#42759) 2019-05-31 13:05:13 -04:00
search.asciidoc SQL: document the use of a filter on _routing (#52355) 2020-02-14 19:00:26 +02:00
string.asciidoc SQL: document the use of a filter on _routing (#52355) 2020-02-14 19:00:26 +02:00
system.asciidoc SQL: document the use of a filter on _routing (#52355) 2020-02-14 19:00:26 +02:00
type-conversion.asciidoc SQL: document the use of a filter on _routing (#52355) 2020-02-14 19:00:26 +02:00