tustvold opened a new issue, #7332:
URL: https://github.com/apache/arrow-datafusion/issues/7332

   ### Describe the bug
   
   is_distinct_from is computed as
   
   ```
   left_isnull != right_isnull || left_value != right_value
   ```
   
   This is incorrect as regardless of if `left_value != right_value` if both 
`left_isnull & right_isnull` the result should be false.
   
   IsNotDistinct has the same issue
   
   This appears to have been introduced in #4560
   
   ### To Reproduce
   
   ```
    #[test]
       fn is_distinct_from_nulls() -> Result<()> {
           // [0, 0, NULL, 0, 0, 0]
           let left_int_array = Int32Array::new(
               vec![0, 0, 1, 3, 0, 0].into(),
               Some(NullBuffer::from(vec![true, true, false, true, true, 
true])),
           );
           // [0, NULL, NULL, NULL, 0, NULL]
           let right_int_array = Int32Array::new(
               vec![0; 6].into(),
               Some(NullBuffer::from(vec![
                   true, false, false, false, true, false,
               ])),
           );
   
           assert_eq!(
               BooleanArray::from(vec![
                   Some(false),
                   Some(true),
                   Some(false),
                   Some(true),
                   Some(false),
                   Some(true),
               ]),
               is_distinct_from(&left_int_array, &right_int_array)?
           );
       }
   ```
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


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