Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/11565#discussion_r55643000
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
@@ -384,9 +374,25 @@ object ColumnPruning extends Rule[LogicalPlan] {
// Eliminate no-op Projects
case p @ Project(projectList, child) if sameOutput(child.output,
p.output) => child
+ // Eliminate no-op Window
+ case w: Window if sameOutput(w.child.output, w.output) => w.child
+
+ // Convert Aggregate to Project if no aggregate function exists
+ case a: Aggregate if !containsAggregates(a.expressions) =>
+ Project(a.aggregateExpressions, a.child)
--- End diff --
Anyway, I think this is a rare case. Will not do it in this PR
---
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]