ulysses-you commented on a change in pull request #30029:
URL: https://github.com/apache/spark/pull/30029#discussion_r504524266



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -646,9 +646,9 @@ class Analyzer(
         // Since the exprId of extraAggExprs will be changed in the 
constructed aggregate, and the
         // aggregateExpressions keeps the input order. So here we build an 
exprMap to resolve the
         // condition again.
-        val exprMap = extraAggExprs.zip(
-          newChild.asInstanceOf[Aggregate].aggregateExpressions.takeRight(
-            extraAggExprs.length)).toMap
+        // We also add the original aggregateExpressions in Map to avoid 
extraAggExprs is empty.

Review comment:
       The comment is right if we not return the resolved having condition when 
`exprMap` is empty, this pr break the behavior that return it.
   
   If we not add the original aggregateExpressions, we can't mapping the 
resolved having condition since `exprMap` is empty.
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to