cloud-fan commented on a change in pull request #30029:
URL: https://github.com/apache/spark/pull/30029#discussion_r504515443



##########
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:
       I don't get it. The comment says
   ```
           // 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.
   ```
   I don't see why we need to include the original aggregateExpressions in 
`exprMap`.




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