Skip to content

Allow casting durations to different timeunits #11097

@simonvandel

Description

@simonvandel

Is your feature request related to a problem or challenge?

I would like to be able to cast a duration to a different timeunit.
Current behavior:

DataFusion CLI v39.0.0
> SELECT arrow_cast(1, 'Duration(Millisecond)');
+----------------------------------------------------+
| arrow_cast(Int64(1),Utf8("Duration(Millisecond)")) |
+----------------------------------------------------+
| 0 days 0 hours 0 mins 0.001 secs                   |
+----------------------------------------------------+
1 row(s) fetched. 
Elapsed 0.065 seconds.

> SELECT arrow_cast(arrow_cast(1, 'Duration(Millisecond)'), 'Duration(Second)');

This feature is not implemented: Unsupported CAST from Duration(Millisecond) to Duration(Second)

Describe the solution you'd like

The cast works

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions