Github user sryza commented on the pull request:
https://github.com/apache/spark/pull/5868#issuecomment-98895765
I agree that the #3438 is a poor choice for aggregation. However I'd like
to emphasize that the approach isn't specialized for sortByKey. Any shuffle
that rearranges the data but doesn't smush it together, i.e. repartition,
groupByKey, repartitionAndSortWithinPartitions (which is useful for
implementing window functions), join, and cogroup, stands to benefit.
The primary advantage of a #3438 -like approach is that, on the reduce
side, only O(1) records need to be deserialized / in-memory at once. With
records stored as java objects, this eases a ton of memory usage and GC
pressure. Even if we're able to use unsafe magic to avoid the GC bit, a
reduce-side merge (instead of sort) means that we don't need to uncompress more
than O(1) records at once.
Regarding merging large numbers of streams, the patch for #3438 includes a
tiered merge to help ameliorate this.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]