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

Commit

Permalink
Improved performance of is_no_null. (#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao authored Nov 12, 2021
1 parent eb6ef19 commit e661065
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit e661065

Please sign in to comment.