kazantsev-maksim commented on code in PR #5622:
URL: https://github.com/apache/datafusion-comet/pull/5622#discussion_r3927110325


##########
spark/src/test/resources/sql-tests/expressions/math/abs_ansi.sql:
##########
@@ -104,3 +104,8 @@ SELECT abs(v) FROM ansi_test_abs_byte
 -- literal
 query expect_error(overflow)
 SELECT abs(cast(-128 as tinyint))
+
+-- overflow: abs on Long.MinValue microseconds throws; the dispatched codegen 
path must
+-- propagate Spark's exception
+query expect_error(overflow)
+SELECT abs(make_dt_interval(-2147483648))

Review Comment:
   Thanks for this catch! Fixed: `abs(make_dt_interval(-106751991, -4, 0, 
-54.775808))` (exactly Long.MinValue µs, error now raised by `Abs` itself) and 
added `abs(make_ym_interval(0, -2147483648))` in both ANSI and non-ANSI files — 
Spark's `Abs` on interval types calls `negateExact` unconditionally, so the 
overflow is expected in both modes.



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