ulysses-you commented on a change in pull request #30330:
URL: https://github.com/apache/spark/pull/30330#discussion_r521219561



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Canonicalize.scala
##########
@@ -109,6 +109,13 @@ object Canonicalize {
     // order the list in the In operator
     case In(value, list) if list.length > 1 => In(value, 
list.sortBy(_.hashCode()))
 
+    case g: Greatest =>
+      val newChildren = orderCommutative(g, { case Greatest(children) => 
children })
+      Greatest(newChildren)

Review comment:
       We can just flatMap the nested `Greatest` to one Greatest.




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