Skip to content

[9.1] Fixes esql class cast bug in STATS at planning level (#137511)#139115

Merged
ncordon merged 2 commits intoelastic:9.1from
ncordon:backport/9.1/pr-137511
Dec 11, 2025
Merged

[9.1] Fixes esql class cast bug in STATS at planning level (#137511)#139115
ncordon merged 2 commits intoelastic:9.1from
ncordon:backport/9.1/pr-137511

Conversation

@ncordon
Copy link
Contributor

@ncordon ncordon commented Dec 5, 2025

Backport

This will backport the following commits from main to 9.1 #137511

Description

Addresses #133992 and #136598, partially.

Missing from this pr that we still need to do: at the moment the runtime part tries to avoid double computations, resulting in exceptions if the plan is correct but not optimal. In other words, queries like:

from airports 
rename scalerank AS x 
stats  a = count(x), b = count(x) + count(x), c = count_distinct(x)

should had never failed at runtime even if the plan was not optimal for repeated aggregations.

@ncordon ncordon added >bug backport Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL v9.1.9 labels Dec 5, 2025
@ncordon ncordon force-pushed the backport/9.1/pr-137511 branch 2 times, most recently from 4cf3bc1 to 510740e Compare December 8, 2025 22:28
Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ncordon ncordon merged commit 314aadd into elastic:9.1 Dec 11, 2025
34 checks passed
@ncordon ncordon deleted the backport/9.1/pr-137511 branch December 11, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL backport >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.1.10

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants