GitHub user reggert opened a pull request:
https://github.com/apache/spark/pull/15899
[SPARK-18466] added withFilter method to RDD
## What changes were proposed in this pull request?
A `withFilter` method has been added to `RDD` as an alias for the `filter`
method. When using `for` comprehensions, the Scala compiler prefers (and as of
2.12, _requires_) the lazy `withFilter` method, only falling back to using the
`filter` method (which, for regular collections, is non-lazy, but for RDDs is
lazy). Prior to Scala 2.12, this fallback causes the compiler to emit a
warning, and as of Scala 2.12, it results in an error.
## How was this patch tested?
`RDDSuite` was updated by adding a line to "basic operations" that
duplicates the behavior of the `filter` test, but uses a `for` comprehension
instead of a direct method call.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/reggert/spark feature/withfilter
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/15899.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 #15899
----
commit db9cf5a9627755e1c8e212b7f29d54dc8bed1c54
Author: Richard W. Eggert II <[email protected]>
Date: 2016-11-16T05:52:27Z
[SPARK-18466] added withFilter method to RDD
----
---
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]