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

Commit

Permalink
Update to MutableBitmap::extend_constant to initialize a Bitmap of …
Browse files Browse the repository at this point in the history
…all true values.
  • Loading branch information
silathdiir committed Dec 25, 2021
1 parent 4dfbe3f commit ad36ece
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compute/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ pub fn and_scalar(array: &BooleanArray, scalar: &BooleanScalar) -> BooleanArray
pub fn or_scalar(array: &BooleanArray, scalar: &BooleanScalar) -> BooleanArray {
match scalar.value() {
Some(true) => {
let values = Bitmap::from_trusted_len_iter(std::iter::repeat(true).take(array.len()));
BooleanArray::from_data(DataType::Boolean, values, array.validity().cloned())
let mut values = MutableBitmap::new();
values.extend_constant(array.len(), true);
BooleanArray::from_data(DataType::Boolean, values.into(), array.validity().cloned())
}
Some(false) => array.clone(),
None => BooleanArray::new_null(DataType::Boolean, array.len()),
Expand Down

0 comments on commit ad36ece

Please sign in to comment.