-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Remove AggregateMapper reflection, and delegate intermediate state to suppliers #122023
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESQL: Remove AggregateMapper reflection, and delegate intermediate state to suppliers #122023
Conversation
|
||
@Override | ||
public AggregatorFunctionSupplier supplier(List<Integer> inputChannels) { | ||
if (inputChannels.size() != 2 && inputChannels.size() != 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion can't be done now, unless we manually change the autogenerated function suppliers.
I don't think it's "required" though
Pinging @elastic/es-analytical-engine (Team:Analytics) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a lot nicer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for simplifying AggregateMapper!
# Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/AggregateMapper.java
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
…ate to suppliers (elastic#122023) To avoid having AggregateMapper find aggregators based on their names with reflection, I'm doing some changes: - Make the suppliers have methods returning the intermediate states - To allow this, the suppliers constructor won't receive the chanells as params. Instead, its methods will ask for them - Most changes in this PR are because of this - After those changes, I'm leaving AggregateMapper still there, as it still converts AggregateFunctions to its NamedExpressions (cherry picked from commit 7bea3a5) # Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/AggregateMapper.java
8.x backport waiting for backport of #119889 |
…ate to suppliers (#122023) (#122183) To avoid having AggregateMapper find aggregators based on their names with reflection, I'm doing some changes: - Make the suppliers have methods returning the intermediate states - To allow this, the suppliers constructor won't receive the chanells as params. Instead, its methods will ask for them - Most changes in this PR are because of this - After those changes, I'm leaving AggregateMapper still there, as it still converts AggregateFunctions to its NamedExpressions (cherry picked from commit 7bea3a5) # Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/AggregateMapper.java
…ate to suppliers (#122023) (#122380) Manual 8.x backport of #122023 To avoid having AggregateMapper find aggregators based on their names with reflection, I'm doing some changes: - Make the suppliers have methods returning the intermediate states - To allow this, the suppliers constructor won't receive the chanells as params. Instead, its methods will ask for them - Most changes in this PR are because of this - After those changes, I'm leaving AggregateMapper still there, as it still converts AggregateFunctions to its NamedExpressions
Don't be afraid of the amount of files: Most changes are trivial refactors along all aggregators/functions/tests.
To avoid having AggregateMapper find aggregators based on their names with reflection, I'm doing some changes:
In general, I think the change fits very well:
Things in progress