spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgaido91 <...@git.apache.org>
Subject [GitHub] spark pull request #20560: [SPARK-23375][SQL] Eliminate unneeded Sort in Opt...
Date Wed, 11 Apr 2018 07:57:23 GMT
Github user mgaido91 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20560#discussion_r180664857
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
    @@ -733,6 +735,17 @@ object EliminateSorts extends Rule[LogicalPlan] {
       }
     }
     
    +/**
    + * Removes Sort operation if the child is already sorted
    + */
    +object RemoveRedundantSorts extends Rule[LogicalPlan] {
    +  def apply(plan: LogicalPlan): LogicalPlan = plan transform {
    +    case Sort(orders, true, child) if child.outputOrdering.nonEmpty
    +        && SortOrder.orderingSatisfies(child.outputOrdering, orders) =>
    +      child
    +  }
    --- End diff --
    
    Yes, you're right. Probably we can do this in other PR. May you open a JIRA for this?
Thanks!


---

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


Mime
View raw message