-
Notifications
You must be signed in to change notification settings - Fork 135
IGNITE-23335: Sql. Do not store aggregation state in Accumulators #4522
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
Conversation
9e4e2c6 to
5bdfc3c
Compare
Extract state from AccumulatorWrapper.
...ine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/agg/AccumulatorWrapper.java
Show resolved
Hide resolved
...ql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/agg/Accumulators.java
Outdated
Show resolved
Hide resolved
...ql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/agg/Accumulators.java
Outdated
Show resolved
Hide resolved
...ql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/agg/Accumulators.java
Show resolved
Hide resolved
AccumulatorWrapper javadoc
Use named arguments in Sum*AccumulatorTests.
Use mutable holders for long and double.
...sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/agg/MutableLong.java
Outdated
Show resolved
Hide resolved
Remove equals/hashCode from MutableLong.
# Conflicts: # modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/agg/Accumulators.java
AggregateRow should only store state.
|
|
||
| acc.accumulator().end(state, result); | ||
|
|
||
| output[i + cardinality] = acc.convertResult(result.get()); |
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.
Can allFields be replaced with mapping?
i + cardinality can be mapping.get(i)
Or allFields may differ from row to row?
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.
Mapping would make things even more confusing, because there are the following lines at the end of this method.
if (groupId != NO_GROUP_ID && type == AggregateType.MAP) {
output[output.length - 1] = groupId;
}
Modifies
AggregateRowby removing all not state related fields from it.Makes
AccumulatorandAccumulatorWrapperstateless.https://issues.apache.org/jira/browse/IGNITE-23335
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
The Review Checklist
- There is a single JIRA ticket related to the pull request.
- The web-link to the pull request is attached to the JIRA ticket.
- The JIRA ticket has the Patch Available state.
- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
Notes