shivadarshan-devadiga commented on code in PR #60749:
URL: https://github.com/apache/spark/pull/60749#discussion_r4642337741
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -4394,6 +4403,17 @@ class Analyzer(
(resolved, other)
}
+ /**
+ * The attributes defined by the Window nodes of this query block below
`plan`, which
+ * ExtractWindowExpressions creates for the window functions of the SELECT
list.
+ */
+ private def windowOutputs(plan: LogicalPlan): AttributeSet = plan match {
+ case w: Window => w.windowOutputSet ++ windowOutputs(w.child)
+ case p: Project => windowOutputs(p.child)
+ case f: Filter => windowOutputs(f.child)
Review Comment:
You're right, it isn't needed, so I removed it. A `Filter` of the same query
block is never above its `Window` nodes: HAVING can't contain window functions
(`WINDOW_FUNCTION_NOT_ALLOWED_IN_CLAUSE`), so its `Filter` is below them, and
WHERE is below the input `Project`. Walking through it never finds a window.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]