Skip to content

Commit a4fa768

Browse files
author
Andrew Or
committed
Clean the closure, not the RDD
1 parent b79aeb9 commit a4fa768

File tree

1 file changed

+2
-1
lines changed
  • streaming/src/main/scala/org/apache/spark/streaming/dstream

1 file changed

+2
-1
lines changed

streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ abstract class DStream[T: ClassTag] (
553553
// because the DStream is reachable from the outer object here, and because
554554
// DStreams can't be serialized with closures, we can't proactively check
555555
// it for serializability and so we pass the optional false to SparkContext.clean
556-
transform((r: RDD[T], t: Time) => context.sparkContext.clean(transformFunc(r), false))
556+
val cleanedF = context.sparkContext.clean(transformFunc, false)
557+
transform((r: RDD[T], t: Time) => cleanedF(r))
557558
}
558559

559560
/**

0 commit comments

Comments
 (0)