Github user andrewor14 commented on the pull request:
https://github.com/apache/spark/pull/5685#issuecomment-96107937
Yes, this also affects user programs. For example I modified SparkPi to
follow the pattern I described in the PR description
```
...
val slices = if (args.length > 0) args(0).toInt else 2
(1 to 1).foreach { j =>
val count = spark.parallelize(1 until n, slices).map { i =>
val z = slices // *** This is the culprit ***
val x = random * 2 - 1
val y = random * 2 - 1
if (x * x + y * y < 1) 1 else 0
}.reduce(_ + _)
}
...
```
If you run this in master branch you will run into a task not serializable
exception. I was able to verify that this patch fixes this as long as
`spark.closureCleaner.transitive` is enabled. If this is not enabled, if fails
with the same exception as before.
---
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]