Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
fix bug in any kernel (#744)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored Jan 9, 2022
1 parent 1c78fe9 commit a4383b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compute/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ pub fn any(array: &BooleanArray) -> bool {
array.into_iter().any(|v| v == Some(true))
} else {
let vals = array.values();
vals.null_count() != 0
vals.null_count() != vals.len()
}
}

Expand Down
6 changes: 6 additions & 0 deletions tests/it/compute/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,10 @@ fn test_any_all() {
let array = BooleanArray::from_iter([true, false, true, true].map(Some));
assert!(!all(&array));
assert!(any(&array));
let array = BooleanArray::from(&[Some(true)]);
assert!(any(&array));
assert!(all(&array));
let array = BooleanArray::from(&[Some(false)]);
assert!(!any(&array));
assert!(!all(&array));
}

0 comments on commit a4383b1

Please sign in to comment.