Describe the bug
When adding two SMALLINT values near the upper bound, the result appears to wrap around instead of raising an overflow error.
To Reproduce
select CAST(32767 AS SMALLINT) + CAST(2 AS SMALLINT);
In DuckDB, it will return the following:
Out of Range Error: Overflow in addition of INT16 (32767 + 2)!
But in datafusion, it will return the different result:
+-------------------------+
| Int64(32767) + Int64(2) |
+-------------------------+
| -32767 |
+-------------------------+
1 row(s) fetched.
Elapsed 0.005 seconds.
Expected behavior
The query should fail with an overflow error.
Additional context
No response
Describe the bug
When adding two
SMALLINTvalues near the upper bound, the result appears to wrap around instead of raising an overflow error.To Reproduce
In DuckDB, it will return the following:
But in datafusion, it will return the different result:
Expected behavior
The query should fail with an overflow error.
Additional context
No response