Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12217#discussion_r59693490
  
    --- 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 --
    
    @jkbradley  Is it because the code uses `zeroValue`, possibly modifying it, 
before you copy it? what about copying it before line 1085?


---
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]

Reply via email to