Skip to content

Conversation

@bpintea
Copy link
Contributor

@bpintea bpintea commented Nov 13, 2024

Backports the following commits to 8.x:

…c#115858)

This adds a new optimiser rule to extract aggregate functions filtered by a `FALSE` or `NULL` into evals. The value taken by the evaluation is `0L`, for `COUNT()` and `COUNT_DISTINCT()`, `NULL` otherwise.

Example:
```
... | STATS x = someAgg(y) WHERE FALSE {BY z} | ...
=>
... | STATS x = someAgg(y) {BY z} > | EVAL x = NULL | KEEP x{, z} | ...
```

Related: elastic#114352.
@bpintea bpintea added :Analytics/ES|QL AKA ESQL >enhancement auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) test-update-serverless labels Nov 13, 2024
@elasticsearchmachine elasticsearchmachine merged commit fa541d2 into elastic:8.x Nov 13, 2024
16 checks passed
@bpintea bpintea deleted the backport/8.x/pr-115858 branch November 13, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) test-update-serverless v8.17.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants