Skip to content

Commit 63c0ff9

Browse files
srowenJoshRosen
authored andcommitted
SPARK-785 [CORE] ClosureCleaner not invoked on most PairRDDFunctions
This looked like perhaps a simple and important one. `combineByKey` looks like it should clean its arguments' closures, and that in turn covers apparently all remaining functions in `PairRDDFunctions` which delegate to it. Author: Sean Owen <sowen@cloudera.com> Closes apache#3690 from srowen/SPARK-785 and squashes the following commits: 8df68fe [Sean Owen] Clean context of most remaining functions in PairRDDFunctions, which ultimately call combineByKey (cherry picked from commit 2a28bc6) Signed-off-by: Josh Rosen <joshrosen@databricks.com>
1 parent b060014 commit 63c0ff9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ class PairRDDFunctions[K: ClassTag, V: ClassTag](self: RDD[(K, V)])
8787
throw new SparkException("Default partitioner cannot partition array keys.")
8888
}
8989
}
90-
val aggregator = new Aggregator[K, V, C](createCombiner, mergeValue, mergeCombiners)
90+
val aggregator = new Aggregator[K, V, C](
91+
self.context.clean(createCombiner),
92+
self.context.clean(mergeValue),
93+
self.context.clean(mergeCombiners))
9194
if (self.partitioner == Some(partitioner)) {
9295
self.mapPartitionsWithContext((context, iter) => {
9396
new InterruptibleIterator(context, aggregator.combineValuesByKey(iter, context))

0 commit comments

Comments
 (0)