gengliangwang commented on code in PR #39773:
URL: https://github.com/apache/spark/pull/39773#discussion_r1091316642
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveLateralColumnAliasReference.scala:
##########
@@ -104,7 +112,10 @@ object ResolveLateralColumnAliasReference extends
Rule[LogicalPlan] {
// phase 2: unwrap
plan.resolveOperatorsUpWithPruning(
_.containsPattern(LATERAL_COLUMN_ALIAS_REFERENCE), ruleId) {
- case p @ Project(projectList, child) if p.resolved
+ case p @ Project(projectList, child) if
+ (p.resolved
+ // can also work on nodes that contains Window but have all others
resolved
+ || (projectList.exists(hasWindowExpression) &&
exprsAndChildResolved(p)))
Review Comment:
`p.resolved || (projectList.exists(hasWindowExpression) &&
exprsAndChildResolved(p))` shows up multiple times. Shall we abstract them into
a method?
--
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]