EnricoMi commented on code in PR #39754:
URL: https://github.com/apache/spark/pull/39754#discussion_r1699637467
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:
##########
@@ -302,6 +308,16 @@ trait CheckAnalysis extends PredicateHelper with
LookupCatalog with QueryErrorsB
// general unresolved check below to throw a more tailored error
message.
new
ResolveReferencesInAggregate(catalogManager).checkUnresolvedGroupByAll(operator)
+ getAllExpressions(operator).foreach(_.foreach {
+ case se: ScopedExpression if !se.resolved =>
Review Comment:
Added in b0510ff7bfd.
##########
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:
Added in 894368e1432.
--
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]