cloud-fan commented on code in PR #39754:
URL: https://github.com/apache/spark/pull/39754#discussion_r1473827300
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -3468,6 +3448,52 @@ class Analyzer(override val catalogManager:
CatalogManager) extends RuleExecutor
}
}
+ /**
+ * Restricts the scope of resolving some expressions.
+ */
+ object ScopeExpressions extends Rule[LogicalPlan] {
+ private def scopeOrder(scope: Seq[Attribute])(sortOrder: SortOrder):
SortOrder = {
+ sortOrder match {
+ case so if so.child.isInstanceOf[ScopedExpression] => so
+ case so => so.copy(child = ScopedExpression(so.child, scope))
Review Comment:
`SortOrder` has `sameOrderExpressions`, shall we scope them as well, or
assert they are empty here?
--
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]