You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "xiedeyantu (via GitHub)" <gi...@apache.org> on 2026/04/02 13:18:41 UTC

[I] SMALLINT addition overflow should error instead of silently wrapping [datafusion]

xiedeyantu opened a new issue, #21318:
URL: https://github.com/apache/datafusion/issues/21318

   ### 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
   
   ```sql
   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_


-- 
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: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] SMALLINT addition overflow should error instead of silently wrapping [datafusion]

Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu closed issue #21318: SMALLINT addition overflow should error instead of silently wrapping
URL: https://github.com/apache/datafusion/issues/21318


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] SMALLINT addition overflow should error instead of silently wrapping [datafusion]

Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on issue #21318:
URL: https://github.com/apache/datafusion/issues/21318#issuecomment-4177816336

   take


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org