Skip to content

Precision loss when coercing date_part utf8 argument #7847

@Dandandan

Description

@Dandandan

Describe the bug

In a recent version of DataFusion

select date_part('second', '2020-09-08T12:00:12.12345678+00:00');
+----------------------------------------------------------------------+
| date_part(Utf8("second"),Utf8("2020-09-08T12:00:12.12345678+00:00")) |
+----------------------------------------------------------------------+
| 12.0                                                                 |
+----------------------------------------------------------------------+

Expected (I get this answer in DataFusion 28).

❯ select date_part('second', '2020-09-08T12:00:12.12345678+00:00');
+----------------------------------------------------------------------+
| date_part(Utf8("second"),Utf8("2020-09-08T12:00:12.12345678+00:00")) |
+----------------------------------------------------------------------+
| 12.12345678                                                          |
+----------------------------------------------------------------------+
1 row in set. Query took 0.015 seconds.

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions