Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/5959#discussion_r29976425
--- Diff:
core/src/test/scala/org/apache/spark/util/ClosureCleanerSuite.scala ---
@@ -260,6 +265,25 @@ private object TestUserClosuresActuallyCleaned {
def testMapPartitionsWithIndex(rdd: RDD[Int]): Unit = {
rdd.mapPartitionsWithIndex { (_, it) => return; it }.count()
}
+ def testFlatMapWith(rdd: RDD[Int]): Unit = {
+ import java.util.Random
+ rdd.flatMapWith ((index: Int) => new Random(index + 42)){ (_, it) =>
return; Seq() }.count()
+ }
+ def testMapWith(rdd: RDD[Int]): Unit = {
+ import java.util.Random
+ rdd.mapWith ((index: Int) => new Random(index + 42)){ (_, it) =>
return; 0 }.count()
+ }
+ def testFilterWith(rdd: RDD[Int]): Unit = {
+ import java.util.Random
+ rdd.filterWith ((index: Int) => new Random(index + 42)){ (_, it) =>
return; true }.count()
+ }
+ def testForEachWith(rdd: RDD[Int]): Unit = {
+ import java.util.Random
--- End diff --
you can just import this once at the very top instead of doing it many times
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]