Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11480#discussion_r54840678
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
 ---
    @@ -483,6 +484,25 @@ object CollapseRepartition extends Rule[LogicalPlan] {
     }
     
     /**
    + * Collapse two adjacent [[Sort]] operators into one if possible. Keep the 
last sort
    + * This rule applies to the scenario where the global is same for the Sort 
nodes and then
    + * either a) The sorts are adjacent or b) In between two Sort nodes, there 
is a Filter or
    + * a Project or a Limit
    + */
    +object CollapseSorts extends Rule[LogicalPlan] {
    +  def apply(plan: LogicalPlan): LogicalPlan = plan transform {
    --- End diff --
    
    And if we do it, we probably want to do it based on some output constraint 
of a plan


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to