Skip to content

Float to int cast behaviour #11886

@oleggator

Description

@oleggator

At the moment, DataFusion casts floats to integers using the floor function.
Is it possible to configure this behavior?

Actual

select cast(2.8 as int) as result;
+--------+
| result |
+--------+
| 2      |
+--------+

Expected

This way work Postgresql and MySQL.

select cast(2.8 as int) as result;
+--------+
| result |
+--------+
| 3      |
+--------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions