bjchambers commented on issue #527:
URL: https://github.com/apache/arrow-rs/issues/527#issuecomment-883716820


   I have some kernels doing time arithmetic for a personal project. I think it 
is helpful to consider more than just durations since, those are the easiest 
case. Specifically, we should also be able to add intervals to timestamps.
   
   I think it may be difficult to do these using existing arithmetic kernels. 
For the case of fixed durations (5000 seconds) it may be possible, but when 
handling intervals we'll need special kernels (eg., add 5 calendar days). One 
possible interface would be something like `add_time<Time, Delta>(time: 
&PrimitiveArray<Time>, delta: &PrimitiveArray<Delta>) -> PrimitiveArray<Time>`, 
for some traits that define temporal types and deltas.
   
   Then we can use `chrono` and `chronoutil` to support adding a duration or 
relative duration by having implementations of something like an 
`ArrowTimeDelta` trait for the data types that represent fixed or relative 
durations.


-- 
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]


Reply via email to