jorisvandenbossche commented on pull request #12105:
URL: https://github.com/apache/arrow/pull/12105#issuecomment-1009760541


   So if `"subtract"` for timestamp results in duration type, I think 
`subtract(time, time)` should also give duration? (and not interval)
   
   And it seems that for subtracting time values to get an interval, we 
actually already have this covered with the `"<interval type>_between"` kernels:
   
   ```
   In [14]: reg = pc.function_registry()
   
   In [15]: reg.get_function("month_day_nano_interval_between").kernels
   Out[15]: 
   [ScalarKernel<(any[date32[day]], any[date32[day]]) -> 
month_day_nano_interval>,
    ScalarKernel<(any[date64[ms]], any[date64[ms]]) -> month_day_nano_interval>,
    ScalarKernel<(any[time32[s]], any[time32[s]]) -> month_day_nano_interval>,
    ScalarKernel<(any[time32[ms]], any[time32[ms]]) -> month_day_nano_interval>,
    ScalarKernel<(any[time64[us]], any[time64[us]]) -> month_day_nano_interval>,
    ScalarKernel<(any[time64[ns]], any[time64[ns]]) -> month_day_nano_interval>,
    ScalarKernel<(any[timestamp(s)], any[timestamp(s)]) -> 
month_day_nano_interval>,
    ScalarKernel<(any[timestamp(ms)], any[timestamp(ms)]) -> 
month_day_nano_interval>,
    ScalarKernel<(any[timestamp(us)], any[timestamp(us)]) -> 
month_day_nano_interval>,
    ScalarKernel<(any[timestamp(ns)], any[timestamp(ns)]) -> 
month_day_nano_interval>]
   ```
   


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