Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/11480#discussion_r54840644
--- 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 --
as it is, i'm not sure how useful this rule is.
I think what would be useful is to have an EliminateSort rule, that can
actually eliminate the more useful cases.
---
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]