alamb commented on code in PR #5971:
URL: https://github.com/apache/arrow-datafusion/pull/5971#discussion_r1165884535
##########
datafusion/common/src/scalar.rs:
##########
@@ -1192,9 +1192,9 @@ pub fn seconds_add_array<const INTERVAL_MODE: i8>(
#[inline]
pub fn milliseconds_add(ts_ms: i64, scalar: &ScalarValue, sign: i32) ->
Result<i64> {
- let secs = ts_ms / 1000;
- let nsecs = ((ts_ms % 1000) * 1_000_000) as u32;
- do_date_time_math(secs, nsecs, scalar, sign).map(|dt|
dt.timestamp_millis())
+ let secs = ts_ms.div_euclid(1000);
Review Comment:
TIL `div_euclid`
--
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]