GitHub user willb opened a pull request:
https://github.com/apache/spark/pull/717
SPARK-571: forbid return statements in cleaned closures
This patch checks top-level closure arguments to `ClosureCleaner.clean` for
`return` statements and raises an exception if it finds any. This is mainly a
user-friendliness addition, since programs with return statements in closure
arguments will currently fail upon RDD actions with a less-than-intuitive error
message.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/willb/spark spark-571
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/717.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #717
----
commit b017c4779a0bfc54f215bc1135d9d23ee9761c20
Author: William Benton <[email protected]>
Date: 2014-05-09T20:05:49Z
Added a test for SPARK-571
commit 295b6a5960fd9a4509e64b225b0e4b479704978b
Author: William Benton <[email protected]>
Date: 2014-05-09T21:14:37Z
Forbid return statements in closure arguments.
This commit ensures that ClosureCleaner.clean will identify
toplevel return statements in closures and raise an exception
if they are encountered.
This is intended to fix SPARK-571.
----
---
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.
---