Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/11565#discussion_r55636439
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
@@ -387,6 +381,14 @@ object ColumnPruning extends Rule[LogicalPlan] {
// Can't prune the columns on LeafNode
case p @ Project(_, l: LeafNode) => p
+ // Prune windowExpressions and child of Window
+ case p @ Project(_, w: Window) if (w.outputSet --
p.references).nonEmpty =>
+ val newWindowExprs =
w.windowExpressions.filter(p.references.contains)
+ val newGrandChild = prunedChild(w.child, w.references ++
p.references)
--- End diff --
haha, based on your suggestion, I found another rule to eliminate useless
`Window`. : )
---
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]