izveigor opened a new issue, #4181:
URL: https://github.com/apache/arrow-rs/issues/4181
**Is your feature request related to a problem or challenge? Please describe
what you are trying to do.**
`arrow-rs` now does not support cast between `Intervals`.
This can cause difficulties when working with dissimilar intervals.
The example of code:
```
use arrow::array::*;
use arrow_cast::cast;
use arrow_schema::DataType;
use std::sync::Arc;
use arrow::datatypes::{IntervalUnit, IntervalYearMonthType};
fn main() {
let a = IntervalYearMonthArray::from(vec![
IntervalYearMonthType::make_value(1, 1),
IntervalYearMonthType::make_value(2, 2),
IntervalYearMonthType::make_value(3, 3),
]);
let array = Arc::new(a) as ArrayRef;
let b = cast(&array,
&DataType::Interval(IntervalUnit::MonthDayNano)).unwrap();
let c = b.as_any().downcast_ref::<IntervalMonthDayNanoArray>().unwrap();
println!("{:#?}", c); // Casting from Interval(YearMonth) to
Interval(MonthDayNano) not supported
}
```
<!--
A clear and concise description of what the problem is. Ex. I'm always
frustrated when [...]
(This section helps Arrow developers understand the context and *why* for
this feature, in addition to the *what*)
-->
**Describe the solution you'd like**
Add the ability for the function to process the following inputs:
`Interval(IntervalUnit::YearMonth)` -> `Interval(IntervalUnit::MonthDayNano)`
`Interval(IntervalUnit::DayTime)` -> `Interval(IntervalUnit::MonthDayNano)`
<!--
A clear and concise description of what you want to happen.
-->
**Describe alternatives you've considered**
<!--
A clear and concise description of any alternative solutions or features
you've considered.
-->
**Additional context**
<!--
Add any other context or screenshots about the feature request here.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]