rednaxelafx commented on a change in pull request #23701: [SPARK-26741][SQL] 
Allow using aggregate expressions in ORDER BY clause
URL: https://github.com/apache/spark/pull/23701#discussion_r252506453
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ##########
 @@ -1217,7 +1217,7 @@ class Analyzer(
   object ResolveMissingReferences extends Rule[LogicalPlan] {
     def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperatorsUp {
       // Skip sort with aggregate. This will be handled in 
ResolveAggregateFunctions
-      case sa @ Sort(_, _, child: Aggregate) => sa
+      case sa @ Sort(_, _, _: Aggregate) => sa
 
 Review comment:
   Since `ResolveAggregateFunctions` is updated to handle `Sort` with indirect 
children being `Aggregate`, should be update the condition here accordingly so 
that it's more resilient?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to