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
[SPARK-14408][CORE] Changed RDD.treeAggregate to use fold instead of reduce #18198
Conversation
cc @jkbradley, @srowen and @NathanHowell, I opened this at least to check if it really passes the tests after fixing the doc error and test. |
Test build #77729 has started for PR 18198 at commit |
Test build #3777 has finished for PR 18198 at commit
|
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.
LGTM in that it is the same change that looked good before but is rebased and happens to pass tests now. There is no real difference in the change right?
Any comments @jkbradley ? I imagine you approve, now that tests pass. |
Merged to master |
What changes were proposed in this pull request?
Previously,
RDD.treeAggregate
usedreduceByKey
andreduce
in its implementation, neither of which technically allows theseq
/combOps
to modify and return their first arguments.This PR uses
foldByKey
andfold
instead and notes thataggregate
andtreeAggregate
are semantically identical in the Scala doc.Note that this had some test failures by unknown reasons. This was actually fixed in e355460.
The root cause was, the
zeroValue
now becomesAFTAggregator
and it comparestotalCnt
(where the value is actually 0). It starts merging one by one and it keeps returningthis
wheretotalCnt
is 0. So, this looks not the bug in the current change.This is now fixed in the commit. So, this should pass the tests.
How was this patch tested?
Test case added in
RDDSuite
.Closes #12217