Github user mateiz commented on a diff in the pull request:
https://github.com/apache/spark/pull/1064#discussion_r13955604
--- Diff:
core/src/main/scala/org/apache/spark/shuffle/hash/HashShuffleReader.scala ---
@@ -31,10 +31,24 @@ class HashShuffleReader[K, C](
require(endPartition == startPartition + 1,
"Hash shuffle currently only supports fetching one partition")
+ private val dep = handle.dependency
+
/** Read the combined key-values for this reduce task */
override def read(): Iterator[Product2[K, C]] = {
- BlockStoreShuffleFetcher.fetch(handle.shuffleId, startPartition,
context,
- Serializer.getSerializer(handle.dependency.serializer))
+ val iter = BlockStoreShuffleFetcher.fetch(handle.shuffleId,
startPartition, context,
+ Serializer.getSerializer(dep.serializer))
+
+ if (dep.aggregator.isDefined) {
+ if (dep.mapSideCombine) {
+ dep.aggregator.get.combineCombinersByKey(iter, context)
+ } else {
+ dep.aggregator.get.combineValuesByKey(iter, context)
+ }
+ } else if (dep.aggregator.isEmpty && dep.mapSideCombine) {
+ throw new IllegalStateException("Aggregator is empty for reduce-side
combine")
--- End diff --
Shouldn't this say "for map-side combine"?
---
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.
---