askoa commented on code in PR #3603:
URL: https://github.com/apache/arrow-rs/pull/3603#discussion_r1089825670


##########
arrow-array/src/array/run_array.rs:
##########
@@ -504,4 +693,30 @@ mod tests {
         let a = RunArray::<Int32Type>::from_iter(["32"]);
         let _ = RunArray::<Int64Type>::from(a.into_data());
     }
+
+    #[test]
+    fn test_ree_array_accessor() {
+        let input_array = build_input_array(256);
+
+        // Encode the input_array to ree_array
+        let mut builder =
+            PrimitiveRunBuilder::<Int16Type, 
Int32Type>::with_capacity(input_array.len());
+        builder.extend(input_array.clone().into_iter());
+        let run_array = builder.finish();
+        let typed = run_array
+            .downcast_ref::<PrimitiveArray<Int32Type>>()
+            .unwrap();
+
+        let len = input_array.len();
+        for i in 0..len {
+            let actual = typed.value(i);
+            match input_array[i] {
+                Some(val) => assert_eq!(val, actual),
+                None => {

Review Comment:
   The issue here is we do not have any api that checks nullability based on 
logical index. The child arrays can be used to check for nullability on 
physical index. May be a custom function `is_value_null` in `RunArray`?



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to