Skip to content

Commit af73e1f

Browse files
committed
[SPARK-2315] ensure that functions are cleaned
1 parent b87b8c0 commit af73e1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class PromiseRDDFunctions[T : ClassTag](self: RDD[T]) extends Logging with Seria
9090
def promiseFromPartitions[V: ClassTag](f: Seq[Iterator[T]] => V): PromiseRDD[V] = {
9191
val rdd = self
9292
val plist = rdd.partitions
93-
val expr = (ctx: TaskContext) => f(plist.map(s => rdd.iterator(s, ctx)))
93+
val expr = self.context.clean((ctx: TaskContext) => f(plist.map(s => rdd.iterator(s, ctx))))
9494
new PromiseRDD[V](expr, rdd.context, List(new FanOutDep(rdd)))
9595
}
9696

@@ -104,7 +104,7 @@ class PromiseRDDFunctions[T : ClassTag](self: RDD[T]) extends Logging with Seria
104104
RDD[T], TaskContext) => V): PromiseRDD[V] = {
105105
val rdd = self
106106
val plist = rdd.partitions
107-
val expr = (ctx: TaskContext) => f(plist, rdd, ctx)
107+
val expr = self.context.clean((ctx: TaskContext) => f(plist, rdd, ctx))
108108
new PromiseRDD[V](expr, rdd.context, List(new FanOutDep(rdd)))
109109
}
110110

0 commit comments

Comments
 (0)