You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In DataFusion we are trying to add complete date/time support . IN addition to Interval types some of this arithmetic will also likely result in Durations (e.g. timestamp - timestamp -- see #3964)
TBC, the duration should be converted into the nanoseconds portion of MonthDayNano, returning an error or null (depending on CastOptions::safe) in the event of overflow.
As a result of daylight savings time, it would be incorrect to assume a day has 24 hours.
I am not sure what other, if any, casts should be supported
Truncating casts to MonthDayTime might also be worthwhile
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In DataFusion we are trying to add complete date/time support . IN addition to Interval types some of this arithmetic will also likely result in Durations (e.g.
timestamp - timestamp
-- see #3964)However, there is no easy way currently to convert between
Durations
andIntervals
Describe the solution you'd like
Add support for
cast
ing durations to intervals to the cast kernel : https://github.com/apache/arrow-rs/blob/master/arrow-cast/src/cast.rs#L18-L36The following casts should be always supported as they are lossless (
DataType::Interval(IntervalUnit::MonthDayNano)
has nanosecond precision)DataType::Duration(TimeUnit::Second)
<-->DataType::Interval(IntervalUnit::MonthDayNano)
DataType::Duration(TimeUnit::Millisecond)
<-->DataType::Interval(IntervalUnit::MonthDayNano)
DataType::Duration(TimeUnit::Microsecond)
<-->DataType::Interval(IntervalUnit::MonthDayNano)
DataType::Duration(TimeUnit::NanoSecond)
<-->DataType::Interval(IntervalUnit::MonthDayNano)
I am not sure what other, if any, casts should be supported
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: