ulysses-you commented on code in PR #38379:
URL: https://github.com/apache/spark/pull/38379#discussion_r1003919162


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:
##########
@@ -477,7 +477,10 @@ case class Add(
   override protected def withNewChildrenInternal(newLeft: Expression, 
newRight: Expression): Add =
     copy(left = newLeft, right = newRight)
 
-  override lazy val canonicalized: Expression = {
+  override lazy val canonicalized: Expression = dataType match {
+    case _: DecimalType =>

Review Comment:
   thank you @gengliangwang for the catching. 
   can we make it more fine-grained ? Not all decimal add will fail, so we can 
check if we can reorder them safely. e.g., precision and scale in all left and 
right are same.



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