tustvold commented on code in PR #3603: URL: https://github.com/apache/arrow-rs/pull/3603#discussion_r1089827550
########## 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 think given there is no null mask `is_null` should always return false, we could add a `is_logical_null` but I think it might cause confusion and I'm not sure how it would be used in practice. -- 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