cloud-fan commented on code in PR #39722:
URL: https://github.com/apache/spark/pull/39722#discussion_r1101001554
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:
##########
@@ -479,8 +480,11 @@ case class Add(
override lazy val canonicalized: Expression = {
// TODO: do not reorder consecutive `Add`s with different `evalMode`
- val reorderResult =
- orderCommutative({ case Add(l, r, _) => Seq(l, r) }).reduce(Add(_, _,
evalMode))
+ val reorderResult = buildCanonicalizedPlan(
+ { case Add(l, r, _) => Seq(l, r) },
+ { case (l: Expression, r: Expression) => Add(l, r, evalMode)},
+ Some(evalMode)
+ )
if (resolved && reorderResult.resolved && reorderResult.dataType ==
dataType) {
Review Comment:
not related to this PR, @gengliangwang do we have a followup to apply this
fix for multiply?
--
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]