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


##########
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:
   I'm not sure if the spec has defined how to return nullability for RunArray. 
Another similar one is `UnionArray` which also doesn't have validity buffer and 
its `is_null` simply returns false and just asks users to check underlying 
array in `is_null` doc.



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to