MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_ree_array_accessor

Function test_ree_array_accessor

arrow-array/src/array/run_array.rs:1155–1175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1153
1154 #[test]
1155 fn test_ree_array_accessor() {
1156 let input_array = build_input_array(256);
1157
1158 // Encode the input_array to ree_array
1159 let mut builder =
1160 PrimitiveRunBuilder::<Int16Type, Int32Type>::with_capacity(input_array.len());
1161 builder.extend(input_array.iter().copied());
1162 let run_array = builder.finish();
1163 let typed = run_array.downcast::<PrimitiveArray<Int32Type>>().unwrap();
1164
1165 // Access every index and check if the value in the input array matches returned value.
1166 for (i, inp_val) in input_array.iter().enumerate() {
1167 if let Some(val) = inp_val {
1168 let actual = typed.value(i);
1169 assert_eq!(*val, actual)
1170 } else {
1171 let physical_ix = run_array.get_physical_index(i);
1172 assert!(typed.values().is_null(physical_ix));
1173 };
1174 }
1175 }
1176
1177 #[test]
1178 #[cfg_attr(miri, ignore)] // Takes too long

Callers

nothing calls this directly

Calls 7

build_input_arrayFunction · 0.70
lenMethod · 0.45
extendMethod · 0.45
iterMethod · 0.45
finishMethod · 0.45
valueMethod · 0.45
get_physical_indexMethod · 0.45

Tested by

no test coverage detected