Skip to content

round decimal incorrect result #19921

@MichaelScofield

Description

@MichaelScofield

Describe the bug

SELECT ROUND('999.9'::DECIMAL(4,1)) produces 100.0 which is incorrect.

To Reproduce

Launch a datafusion-cli, execute:

./datafusion-cli                                                                          
DataFusion CLI v52.0.0
> SELECT ROUND('999.9'::DECIMAL(4,1));
+----------------------+
| round(Utf8("999.9")) |
+----------------------+
| 100.0                |
+----------------------+
1 row(s) fetched. 
Elapsed 0.020 seconds.

Expected behavior

Expect 1000, like in the postgresql:

postgres=# SELECT ROUND('999.9'::DECIMAL(4,1));
 round
-------
  1000
(1 row)

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions