You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/03/21 17:48:05 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3895: Use BooleanBuffer in BooleanArray (#3879)

tustvold commented on code in PR #3895:
URL: https://github.com/apache/arrow-rs/pull/3895#discussion_r1143789957


##########
arrow-select/src/filter.rs:
##########
@@ -154,15 +152,12 @@ pub fn build_filter(filter: &BooleanArray) -> Result<Filter, ArrowError> {
 pub fn prep_null_mask_filter(filter: &BooleanArray) -> BooleanArray {
     let array_data = filter.data_ref();
     let nulls = array_data.nulls().unwrap();
-    let mask = filter.values();
-    let offset = filter.offset();
-
-    let new_mask =
-        buffer_bin_and(mask, offset, nulls.buffer(), nulls.offset(), filter.len());
+    let mask = filter.values() & nulls.inner();
 
     let array_data = ArrayData::builder(DataType::Boolean)
-        .len(filter.len())
-        .add_buffer(new_mask);
+        .len(mask.len())

Review Comment:
   A follow up PR will add a `BooleanArray::new` method



##########
arrow-select/src/filter.rs:
##########
@@ -154,15 +152,12 @@ pub fn build_filter(filter: &BooleanArray) -> Result<Filter, ArrowError> {
 pub fn prep_null_mask_filter(filter: &BooleanArray) -> BooleanArray {
     let array_data = filter.data_ref();
     let nulls = array_data.nulls().unwrap();
-    let mask = filter.values();
-    let offset = filter.offset();
-
-    let new_mask =
-        buffer_bin_and(mask, offset, nulls.buffer(), nulls.offset(), filter.len());
+    let mask = filter.values() & nulls.inner();
 
     let array_data = ArrayData::builder(DataType::Boolean)
-        .len(filter.len())
-        .add_buffer(new_mask);
+        .len(mask.len())

Review Comment:
   A follow up PR will add a `BooleanArray::new` method to encapsulate this logic



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org