Github user pwendell commented on the pull request:
https://github.com/apache/spark/pull/831#issuecomment-45804638
@holdenk - I think a better way would be to modify the ClosureCleaner. In
that part of the code we already walk through all of the objects referenced
inside of the Closure, so I think you could just check if an object in the
closure is a sub type of RDD. We could chose to throw an exception here or to
just log an error message (I could see some cases where users might have used
this and it actually worked, e.g. if they were including a reference to the RDD
and just calling `getName` or something on it).
The approach now is a bit round about and it relies on some implementation
artifacts to determine when we are in this case. I wonder if we could have a
much smaller/nicer fix by just looking directly at the closure.
---
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.
---