bjchambers edited a comment on issue #1498:
URL: https://github.com/apache/arrow-rs/issues/1498#issuecomment-1081197735
Failing test case.
I believe the `assert_ne!(...)` should be equal, and is why the later thing
fails.
Note that it applies the `nullif` kernel to the same primitive and equal
boolean arrays, but gets different results.
```
#[test]
fn test_bool_array_or_sliced() {
let a: BooleanArray = vec![Some(true), Some(false), None]
.into_iter()
.cycle()
.take(1024)
.collect();
let a = a.slice(0, 3);
let a: &BooleanArray = a.as_any().downcast_ref().unwrap();
let b = BooleanArray::from(vec![true, false, true]);
let c = or(a, &b).unwrap();
let expected = BooleanArray::from(vec![Some(true), Some(false),
None]);
assert_eq!(c, expected);
// `nullif` kernel assumes that for a boolean array these are equal
// since it applies the BitAnd operator between them. Either
`logical_or`
// or `nullif` is broken.
assert_ne!(
c.data().null_buffer().unwrap().len(),
c.data().buffers()[0].len()
);
let p = crate::array::Int64Array::from(vec![5, 6, 7]);
assert_eq!(
crate::compute::nullif(&p, &expected).unwrap(),
crate::compute::nullif(&p, &c).unwrap()
);
}
```
--
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]