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-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to