Skip to content

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

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

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

Conversation

@ncordon
Copy link
Copy Markdown
Member

@ncordon ncordon commented Dec 8, 2025

Backport

This will backport the following commits from main to 8.19 #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.

@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v8.19.9 labels Dec 8, 2025
@ncordon ncordon added >bug backport Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL v8.19.9 and removed needs:triage Requires assignment of a team area label v8.19.9 labels Dec 8, 2025
@ncordon ncordon force-pushed the backport/8.19/pr-137511 branch from 0d0a91b to 87a48d0 Compare December 10, 2025 12:28
@ncordon ncordon force-pushed the backport/8.19/pr-137511 branch from 87a48d0 to fa1ddfc Compare December 10, 2025 14:24
Copy link
Copy Markdown
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 48004f9 into elastic:8.19 Dec 11, 2025
27 checks passed
@ncordon ncordon deleted the backport/8.19/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) v8.19.10

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants