You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a follow-up on issue #11031 and PR #11036, which fixed the incorrect results or infinite loops caused by passing i64::MIN in combination with other values into the GCD scalar function.
While fixing this, we noticed that an overflow occurred when passing i64::MIN in both parameters.
This can also happen in the LCM function, because it depends on GCD.
The real GCD of i64::MIN and i64::MIN is 9223372036854775808, but this can't be represented as an i64 (it is i64::MAX+1), thus we need to return an overflow error.
For example like this:
i64::try_from(a << shift).map_err(|_| exec_datafusion_err!("Overflow in gcd"))
Additional context
Credits to @jonahgao (sorry for the ping, but it is owed)
The text was updated successfully, but these errors were encountered:
Describe the bug
This is a follow-up on issue #11031 and PR #11036, which fixed the incorrect results or infinite loops caused by passing
i64::MIN
in combination with other values into the GCD scalar function.While fixing this, we noticed that an overflow occurred when passing
i64::MIN
in both parameters.This can also happen in the LCM function, because it depends on GCD.
To Reproduce
DataFusion CLI v39.0.0
Expected behavior
The real GCD of
i64::MIN
andi64::MIN
is9223372036854775808
, but this can't be represented as ani64
(it isi64::MAX
+1), thus we need to return an overflow error.For example like this:
Additional context
Credits to @jonahgao (sorry for the ping, but it is owed)
The text was updated successfully, but these errors were encountered: