alamb opened a new issue, #3643: URL: https://github.com/apache/arrow-rs/issues/3643
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.** In DataFusion, we support SQL syntax like `INTERVAL 3 months` that is then converted into `Intervals` (I think originally contributed by @ovr). However we currently only support converting individual values (rather than arrays) **Describe the solution you'd like** I would like the arrow cast kernel https://docs.rs/arrow-cast/32.0.0/arrow_cast/cast/fn.cast.html to support casting to/from strings and intervals `DataType::Interval(_)` <----> `DataType::Utf8/DataType::LargeUtf8` There is some subtlety related to parsing intervals (like if a given interval type can fit a specific range and precision) **Describe alternatives you've considered** **Additional context** The datafusion parse_interval logic is here: https://github.com/apache/arrow-datafusion/blob/1f7885bb48dd33ce7b9df995214393bbff080e08/datafusion/common/src/parsers.rs#L115-L266 I think it would be fairly straightforward to port (along with tests) to arrow-rs I don't think arrow should have the logic that tries to auto-detect the type of the interval -- in DataFusion I think we could simply change the code to try parsing the string as different types of intervals and use the one that first succeeds. -- 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]
