EnricoMi commented on code in PR #39754:
URL: https://github.com/apache/spark/pull/39754#discussion_r1452156089
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -3286,6 +3265,25 @@ class Analyzer(override val catalogManager:
CatalogManager) extends RuleExecutor
}
}
+ /**
+ * Resolves expressions against their scope of attributes.
+ */
+ object ResolveScopedExpression extends Rule[LogicalPlan] {
+ override def apply(plan: LogicalPlan): LogicalPlan =
plan.resolveExpressions {
+ case se: ScopedExpression if se.resolved => se.child
+ case se @ ScopedExpression(expr, attributes) =>
Review Comment:
> we need to make sure `attributes` is a subset of the children output.
I think this only holds for `AttributeReference`, because
`UnresolvedAttribute` that cannot be resolved against children output will
cause an Analyzer error.
--
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]