You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Weijun-H (via GitHub)" <gi...@apache.org> on 2023/04/16 11:08:03 UTC

[GitHub] [arrow-rs] Weijun-H commented on pull request #4020: feat: cast from/to interval and duration

Weijun-H commented on PR #4020:
URL: https://github.com/apache/arrow-rs/pull/4020#issuecomment-1510298083

   > I think this PR is ready to go. I don't totally understand why [#4020 (files)](https://github.com/apache/arrow-rs/pull/4020/files#r1167579187) is not needed, but the test coverage
   > 
   > ```
   >         let array = vec![i64::MAX];
   >         let casted_array = cast_from_duration_to_interval::<DurationMillisecondType>(
   >             array.clone(),
   >             &DEFAULT_CAST_OPTIONS,
   >         )
   >         .unwrap();
   >         assert!(!casted_array.is_valid(0));
   > ```
   > 
   > covers the case I was thinking of so 👍
   > 
   > Thank you @Weijun-H
   
   Because v is `i64` in [#4020 (files)](https://github.com/apache/arrow-rs/pull/4020/files#r1167579187), `checked_mul` will return `None` when overflowing. 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org