db-scnakandala commented on code in PR #46307: URL: https://github.com/apache/spark/pull/46307#discussion_r1591732236
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala: ########## @@ -452,13 +452,14 @@ case class Add( copy(left = newLeft, right = newRight) override lazy val canonicalized: Expression = { - // TODO: do not reorder consecutive `Add`s with different `evalMode` - val reorderResult = buildCanonicalizedPlan( + val evalModes = collectEvalModes(this, {case Add(_, _, evalMode) => Seq(evalMode)}) + lazy val reorderResult = buildCanonicalizedPlan( { case Add(l, r, _) => Seq(l, r) }, Review Comment: That is neat! I will create a follow-up PR. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org