wangyum commented on code in PR #42531:
URL: https://github.com/apache/spark/pull/42531#discussion_r1297310457


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -644,6 +644,8 @@ object PushFoldableIntoBranches extends Rule[LogicalPlan] {
 
   def apply(plan: LogicalPlan): LogicalPlan = plan.transformWithPruning(
     _.containsAnyPattern(CASE_WHEN, IF), ruleId) {
+    case a @ Aggregate(groupingExpressions, _, _)
+      if !groupingExpressions.forall(_.isInstanceOf[NamedExpression]) => a

Review Comment:
   This is because the aggregate contains complex grouping expressions after 
`RedundantAggregates`. So could we fix it there.



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

Reply via email to