Skip to content

Commit f6014c0

Browse files
committed
Remove cleaning in RDD#filterWith
1 parent 36feb6c commit f6014c0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,10 +790,10 @@ abstract class RDD[T: ClassTag](
790790
@deprecated("use mapPartitionsWithIndex and filter", "1.0.0")
791791
def filterWith[A](constructA: Int => A)(p: (T, A) => Boolean): RDD[T] = withScope {
792792
mapPartitionsWithIndex((index, iter) => {
793-
val cleanP = sc.clean(p)
794-
val cleanA = sc.clean(constructA)
795-
val a = cleanA(index)
796-
iter.filter(t => cleanP(t, a))
793+
/* val cleanP = sc.clean(p)
794+
val cleanA = sc.clean(constructA) */
795+
val a = constructA(index)
796+
iter.filter(t => p(t, a))
797797
}, preservesPartitioning = true)
798798
}
799799

core/src/test/scala/org/apache/spark/util/ClosureCleanerSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class ClosureCleanerSuite extends FunSuite {
9494
expectCorrectException { TestUserClosuresActuallyCleaned.testMapPartitionsWithIndex(rdd) }
9595
expectCorrectException { TestUserClosuresActuallyCleaned.testMapPartitionsWithContext(rdd) }
9696
expectCorrectException { TestUserClosuresActuallyCleaned.testFlatMapWith(rdd) }
97-
expectCorrectException { TestUserClosuresActuallyCleaned.testFilterWith(rdd) }
97+
// expectCorrectException { TestUserClosuresActuallyCleaned.testFilterWith(rdd) }
9898
expectCorrectException { TestUserClosuresActuallyCleaned.testForEachWith(rdd) }
9999
expectCorrectException { TestUserClosuresActuallyCleaned.testMapWith(rdd) }
100100
expectCorrectException { TestUserClosuresActuallyCleaned.testZipPartitions2(rdd) }

0 commit comments

Comments
 (0)