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

   ### Describe the bug
   
   `FLOOR('-999.9'::DECIMAL(4,1))` is calculated to "decimal overflow" error.
   
   ### To Reproduce
   
   ```text
   ./datafusion-cli
   DataFusion CLI v52.1.0
   > SELECT FLOOR('-999.9'::DECIMAL(4,1));
   Arrow error: Compute error: Decimal overflow while applying floor
   ```
   
   ### Expected behavior
   
   Like DuckDB, it should return `-1000`:
   
   ```text
   ./duckdb
   DuckDB v1.4.4 (Andium) 6ddac802ff
   Enter ".help" for usage hints.
   Connected to a transient in-memory database.
   Use ".open FILENAME" to reopen on a persistent database.
   D select floor(-'999.9'::decimal(4,1));
   ┌─────────────────────────────────────────┐
   │ floor(-(CAST('999.9' AS DECIMAL(4,1)))) │
   │              decimal(4,0)               │
   ├─────────────────────────────────────────┤
   │                  -1000                  │
   └─────────────────────────────────────────┘
   ```
   
   ### 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: [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