anchovYu commented on code in PR #39269:
URL: https://github.com/apache/spark/pull/39269#discussion_r1058669132


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveLateralColumnAliasReference.scala:
##########
@@ -210,14 +209,10 @@ object ResolveLateralColumnAliasReference extends 
Rule[LogicalPlan] {
                 ne.toAttribute
             }.asInstanceOf[NamedExpression]
           }
-          if (newAggExprs.isEmpty) {
-            agg
-          } else {
-            Project(
-              projectList = projectExprs,
-              child = agg.copy(aggregateExpressions = newAggExprs.toSeq)
-            )
-          }
+          Project(

Review Comment:
   One thing I'm not sure about is if the code path for empty Aggregate 
expressions e.g. `Aggregate [dept] []` exists.



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