alamb commented on a change in pull request #8303:
URL: https://github.com/apache/arrow/pull/8303#discussion_r497414203



##########
File path: rust/arrow/src/compute/kernels/filter.rs
##########
@@ -675,6 +683,29 @@ mod tests {
         assert_eq!(true, d.is_null(0));
     }
 
+    #[test]
+    fn test_filter_string_array_with_null() {
+        let a = StringArray::from(vec![Some("hello"), None, Some("world"), 
None]);
+        let b = BooleanArray::from(vec![true, false, false, true]);
+        let c = filter(&a, &b).unwrap();
+        let d = c.as_ref().as_any().downcast_ref::<StringArray>().unwrap();
+        assert_eq!(2, d.len());
+        assert_eq!("hello", d.value(0));

Review comment:
       I actually think checking `d.value(0)` (aka the value for the index of 
the null element) is probably not a good idea -- if an element is null the 
value shouldn't be checked. I think the `is_null(0)` check is a good one and 
will add that




----------------------------------------------------------------
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:
[email protected]


Reply via email to