pan3793 commented on code in PR #52474:
URL: https://github.com/apache/spark/pull/52474#discussion_r2394234811


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/AliasAwareOutputExpression.scala:
##########
@@ -128,6 +128,9 @@ trait AliasAwareQueryOutputOrdering[T <: QueryPlan[T]]
         }
       }
     }
-    newOrdering.takeWhile(_.isDefined).flatten.toSeq
+    newOrdering.takeWhile(_.isDefined).flatten.toSeq ++ 
outputExpressions.filter {
+      case Alias(child, _) => child.foldable
+      case expr => expr.foldable
+    }.map(SortOrder(_, Ascending).copy(isConstant = true))

Review Comment:
   @peter-toth Many thanks for your professionalism and patience! I tested 
locally, and it did fix the issue. Have educated a lot from your review.



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