cloud-fan commented on a change in pull request #29882:
URL: https://github.com/apache/spark/pull/29882#discussion_r513237676



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Canonicalize.scala
##########
@@ -70,8 +70,10 @@ object Canonicalize {
 
   /** Rearrange expressions that are commutative or associative. */
   private def expressionReorder(e: Expression): Expression = e match {
-    case a: Add => orderCommutative(a, { case Add(l, r) => Seq(l, r) 
}).reduce(Add)
-    case m: Multiply => orderCommutative(m, { case Multiply(l, r) => Seq(l, r) 
}).reduce(Multiply)
+    case a @ Add(_, _, c) =>

Review comment:
       This needs further updates as we can't reorder consecutive `Add`s with 
different `failOnError` flags. It's OK for now as the `Add`s in a query must 
have the same flag. Can we add a TODO here?




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