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

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

Yang Jie created SPARK-36580:
--------------------------------

             Summary: 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


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