Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5959#discussion_r29897233
  
    --- Diff: 
core/src/test/scala/org/apache/spark/util/ClosureCleanerSuite.scala ---
    @@ -260,6 +262,21 @@ 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
    +    val randoms = rdd.flatMapWith(
    +      (index: Int) => new Random(index + 42))
    +      {(t: Int, prng: Random) =>
    +        val random = prng.nextDouble()
    +        Seq(random * t, random * t * 10)}.
    +      count()
    +  }
    +  def testMapWith(rdd: RDD[Int]): Unit = {
    +    import java.util.Random
    +    val randoms = rdd.mapWith(
    +      (index: Int) => new Random(index + 42))
    +      {(t: Int, prng: Random) => prng.nextDouble * t}.count()
    --- End diff --
    
    note that the tests will fail because these closures are expected to have 
`return` statements in them. Can you model these closures after the other ones 
in this test?


---
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]

Reply via email to