Skip to content

Commit

Permalink
Fixed bug in treeAggregate using fold
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbradley committed Apr 8, 2016
1 parent 16e79e3 commit 02d107a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/src/main/scala/org/apache/spark/rdd/RDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1089,9 +1089,8 @@ abstract class RDD[T: ClassTag](
(i, iter) => iter.map((i % curNumPartitions, _))
}.foldByKey(zeroValue, new HashPartitioner(curNumPartitions))(cleanCombOp).values
}
//partiallyAggregated.reduce(cleanCombOp)
// This fails:
partiallyAggregated.fold(zeroValue)(cleanCombOp)
val copiedZeroValue = Utils.clone(zeroValue, sc.env.closureSerializer.newInstance())
partiallyAggregated.fold(copiedZeroValue)(cleanCombOp)
}
}

Expand Down

0 comments on commit 02d107a

Please sign in to comment.