ESQL: Simplify agg construction when reducing node-level#128980
Merged
alex-spies merged 3 commits intoelastic:mainfrom Jun 6, 2025
Merged
ESQL: Simplify agg construction when reducing node-level#128980alex-spies merged 3 commits intoelastic:mainfrom
alex-spies merged 3 commits intoelastic:mainfrom
Conversation
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Contributor
Author
|
All checks passing except for the Serverless checks, which fail due to a compilation error in an unrelated test class - fix already merged. I retried running the Serverless checks multiple times but this seems to take a while for the fix to be picked up. Since this is blocking #128745, I'm going to go ahead with the merge; this is fine as there are no Serverless check failures related to this change, specifically. |
Collaborator
💔 Backport failed
You can use sqren/backport to manually backport by running |
Contributor
Author
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jun 6, 2025
mridula-s109
pushed a commit
to mridula-s109/elasticsearch
that referenced
this pull request
Jun 9, 2025
valeriy42
pushed a commit
to valeriy42/elasticsearch
that referenced
this pull request
Jun 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When we construct an intermediate Aggregate as the node-level reduction step on a data node, we weirdly set the aggregator mode to initial rather than intermediate. Then, later, in
AbstractPhysicalOperationProviders#groupingPhysicalOperation, we do a little dance to detect intermediate aggs in node-level reduction only by checking if the agg's child is an exchange even though the agg mode is initial.This is leaking implementation details of the construction of the node-level reduction agg and makes this hard to grasp. I think it's just a leftover from a time when the compute engine had an intermediate aggregation mode but the planner didn't.
Let's clean that up and just set the agg mode to intermediate right away when constructing the node-level reduction agg.