You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2021/08/25 03:40:00 UTC

[jira] [Commented] (SPARK-36580) Replace filter and contains with intersect

    [ https://issues.apache.org/jira/browse/SPARK-36580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17404161#comment-17404161 ] 

Apache Spark commented on SPARK-36580:
--------------------------------------

User 'LuciferYang' has created a pull request for this issue:
https://github.com/apache/spark/pull/33829

> Replace filter and contains with intersect
> ------------------------------------------
>
>                 Key: SPARK-36580
>                 URL: https://issues.apache.org/jira/browse/SPARK-36580
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 3.3.0
>            Reporter: Yang Jie
>            Priority: Minor
>
> filter on Set can use intersect instead
>  
> *before*
> {code:java}
> val set = Set(1, 2)
> val others = Set(2, 3)
> set.filter(others.contains(_))
> {code}
> *after*
> {code:java}
> val set = Set(1, 2)
> val others = Set(2, 3)
> set.intersect(others)
> {code}
> Semantic consistency, but it looks simpler



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org