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 07:45:56 UTC

[GitHub] [arrow-rs] ritchie46 opened a new issue #295: Fitler has inconsistent null handling

ritchie46 opened a new issue #295:
URL: https://github.com/apache/arrow-rs/issues/295


   **Describe the bug**
   When creating a boolean mask from a comparison operation on an array with null values, the filter kernel yields a different result than when that boolean mask, including null values, is created directly.
   
   
   **To Reproduce**
   
   ```rust
       fn test_null_mask() -> Result<()> {
           use crate::compute::kernels::comparison;
           let a: PrimitiveArray<Int64Type> = PrimitiveArray::from(vec![Some(1), Some(2), None]);
           let mask0 = comparison::eq(&a, &a)?;
           let out0 = filter(&a, &mask0)?;
           let out_arr0 = out0.as_any().downcast_ref::<PrimitiveArray<Int64Type>>().unwrap();
   
           let mask1 = BooleanArray::from(vec![Some(true), Some(true), None]);
           let out1 = filter(&a, &mask1)?;
           let out_arr1 = out1.as_any().downcast_ref::<PrimitiveArray<Int64Type>>().unwrap();
           assert_eq!(mask0, mask1); // assert succes
           assert_eq!(out_arr0, out_arr1);  // assert false
           Ok(())
       }
   ```
   
   **Expected behavior**
   Null values in the predicate mask should be ignored and not yield a result. Which the kernel does correctly on boolean mask that are created directly.
   
   


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



[GitHub] [arrow-rs] Dandandan closed issue #295: Filter has inconsistent null handling

Posted by GitBox <gi...@apache.org>.
Dandandan closed issue #295:
URL: https://github.com/apache/arrow-rs/issues/295


   


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