tustvold commented on code in PR #4244:
URL: https://github.com/apache/arrow-rs/pull/4244#discussion_r1198077349


##########
arrow-arith/src/arithmetic.rs:
##########
@@ -1096,13 +1096,18 @@ pub fn subtract_dyn(left: &dyn Array, right: &dyn 
Array) -> Result<ArrayRef, Arr
                     let res = math_checked_op(l, r, 
TimestampSecondType::subtract_month_day_nano)?;
                     Ok(Arc::new(res.with_timezone_opt(l.timezone())))
                 }
+                DataType::Timestamp(TimeUnit::Second, _) => {
+                    let r = right.as_primitive::<TimestampSecondType>();
+                    let op = <TimestampSecondType as 
ArrowPrimitiveType>::Native::wrapping_sub;
+                    let res: PrimitiveArray<DurationSecondType> = binary(l, r, 
op)?;

Review Comment:
   ```suggestion
                       let res: PrimitiveArray<DurationSecondType> = binary(l, 
r, |a, b| a.wrapping_sub(b))?;
   ```
   Perhaps?



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