You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/05/16 13:52:48 UTC

[GitHub] [arrow-rs] jhorstmann commented on a change in pull request #296: fix invalid null handling in filter

jhorstmann commented on a change in pull request #296:
URL: https://github.com/apache/arrow-rs/pull/296#discussion_r633093885



##########
File path: arrow/src/compute/kernels/filter.rs
##########
@@ -221,6 +223,23 @@ pub fn build_filter(filter: &BooleanArray) -> Result<Filter> {
 /// # }
 /// ```
 pub fn filter(array: &Array, filter: &BooleanArray) -> Result<ArrayRef> {
+    if filter.null_count() > 0 {
+        // this greatly simplifies subsequent filtering code
+        // now we only have a boolean mask to deal with
+        let array_data = filter.data_ref();
+        let null_bitmap = array_data.null_buffer().unwrap();

Review comment:
       I think this needs to take the offset of the array into account, similar to https://github.com/apache/arrow-rs/blob/master/arrow/src/compute/util.rs#L45




-- 
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.

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