Skip to content

round decimal incorrect result #19921

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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