mihailom-db commented on code in PR #48773:
URL: https://github.com/apache/spark/pull/48773#discussion_r1835071345


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalMathUtils.scala:
##########
@@ -31,16 +31,17 @@ object IntervalMathUtils {
 
   def subtractExact(a: Long, b: Long): Long = 
withOverflow(Math.subtractExact(a, b), "try_subtract")
 
-  def negateExact(a: Int): Int = withOverflow(Math.negateExact(a))
+  def negateExact(a: Int): Int = withOverflow(Math.negateExact(a), 
"try_multiply")

Review Comment:
   Unfortunately this is not a safe thing to do. UnaryMinus is introduced in 
analysis by many different functions and we cannot guarantee that the error 
that occurred here is from -x or from some expression that internally converts 
x to -x.



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