Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/12217#discussion_r59790263
--- Diff: core/src/main/scala/org/apache/spark/rdd/RDD.scala ---
@@ -1087,9 +1087,10 @@ abstract class RDD[T: ClassTag](
val curNumPartitions = numPartitions
partiallyAggregated = partiallyAggregated.mapPartitionsWithIndex {
(i, iter) => iter.map((i % curNumPartitions, _))
- }.reduceByKey(new HashPartitioner(curNumPartitions),
cleanCombOp).values
+ }.foldByKey(zeroValue, new
HashPartitioner(curNumPartitions))(cleanCombOp).values
}
- partiallyAggregated.reduce(cleanCombOp)
+ val copiedZeroValue = Utils.clone(zeroValue,
sc.env.closureSerializer.newInstance())
+ partiallyAggregated.fold(copiedZeroValue)(cleanCombOp)
--- End diff --
Hm OK if you've got a copy for each of the 3 usages, that really can't be
it. Unless the clone isn't implemented as a deep clone for the object in
question somehow. Could it be due to a different order of applying the combOp
in this case? that's the only other thing I can think of if this change alone
is the issue.
---
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]