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 2022/03/28 22:03:10 UTC

[GitHub] [arrow-rs] bjchambers commented on issue #1498: "or" kernel applied to slices may be invalid on later operations

bjchambers commented on issue #1498:
URL: https://github.com/apache/arrow-rs/issues/1498#issuecomment-1081197735


   Failing test case:
   
   ```
       #[test]
       fn test_bool_array_or_sliced() {
           let a = vec![Some(true); 1024];
           let a = BooleanArray::from(a);
   
           let a = a.slice(0, 2);
           let a: &BooleanArray = a.as_any().downcast_ref().unwrap();
   
           let b = BooleanArray::from(vec![true, false]);
   
           let c = or(a, &b).unwrap();
   
           let expected = BooleanArray::from(vec![Some(true), Some(true)]);
   
           assert_eq!(c, expected);
   
           // `nullif` kernel assumes that for a boolean array these are equal
           // since it applies the BitAnd operator between them. Either `logical_or`
           // or `nullif` is broken.
           assert_eq!(
               c.data().null_buffer().unwrap().len(),
               c.data().buffers()[0].len()
           );
   
           // This is currently silently discarding the condition.
           // Due to the mentioned `ok()`.
           let p = crate::array::Int64Array::from(vec![5, 6]);
           crate::compute::nullif(&p, &c).unwrap();
       }
   ```


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