berkaysynnada opened a new issue, #5105:
URL: https://github.com/apache/arrow-rs/issues/5105

   **Describe the bug**
   <!--
   A clear and concise description of what the bug is.
   -->
   
   When subtracting `IntervalDayTimeType` instances, `make_value()` function of 
`IntervalDayTimeType` 
   
   
https://github.com/apache/arrow-rs/blob/df69ef57d055453c399fa925ad315d19211d7ab2/arrow-array/src/types.rs#L849C4-L868C6
   
   creates the new instance of difference. However, this function cannot 
properly handle the negative inputs (When the day or millisecond part of the 
difference is negative).
   
   **To Reproduce**
   <!--
   Steps to reproduce the behavior:
   -->
   
   `let a = IntervalDayTimeArray::from(vec![1]);`
   `let b = IntervalDayTimeArray::from(vec![2]);`
   `let result = sub_wrapping(&a, &b).unwrap();`
   `assert_eq!(result.as_ref(), &IntervalDayTimeArray::from(vec![-1]));`
   
   It currently results as `PrimitiveArray<Interval(DayTime)>[4294967295] `
   
   **Expected behavior**
   <!--
   A clear and concise description of what you expected to happen.
   -->
   
   It should give `PrimitiveArray<Interval(DayTime)>[-1] `
   
   **Additional context**
   <!--
   Add any other context about the problem here.
   -->
   
   I believe the same problem exists for `IntervalMonthDayNanoType`'s 
`make_value()` implementation.


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