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

Apache Spark commented on SPARK-40050:
--------------------------------------

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

> Eliminate sort if parent is local limit
> ---------------------------------------
>
>                 Key: SPARK-40050
>                 URL: https://issues.apache.org/jira/browse/SPARK-40050
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.4.0
>            Reporter: Yuming Wang
>            Priority: Major
>
> It seems we can remove Sort operator:
> {code:scala}
>     val projectPlan = testRelation.select($"a", $"b")
>     val unnecessaryOrderByPlan = projectPlan.orderBy($"a".asc)
>     val localLimitPlan = LocalLimit(Literal(2), unnecessaryOrderByPlan)
>     val projectPlanB = testRelationB.select($"d")
>     val joinPlan = localLimitPlan.join(projectPlanB, RightOuter).select($"a", 
> $"d")
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to