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

Improved performance of is_not_null. #600

Merged
merged 1 commit into from
Nov 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/compute/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ pub fn is_null(input: &dyn Array) -> BooleanArray {
/// ```
pub fn is_not_null(input: &dyn Array) -> BooleanArray {
let values = match input.validity() {
None => Bitmap::from_trusted_len_iter(std::iter::repeat(true).take(input.len())),
None => {
let mut mutable = MutableBitmap::new();
mutable.extend_constant(input.len(), true);
mutable.into()
}
Some(buffer) => buffer.clone(),
};
BooleanArray::from_data(DataType::Boolean, values, None)
Expand Down