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

Function test_get_physical_indices

arrow-array/src/array/run_array.rs:1179–1210  ·  view source on GitHub ↗

Takes too long

()

Source from the content-addressed store, hash-verified

1177 #[test]
1178 #[cfg_attr(miri, ignore)] // Takes too long
1179 fn test_get_physical_indices() {
1180 // Test for logical lengths starting from 10 to 250 increasing by 10
1181 for logical_len in (0..250).step_by(10) {
1182 let input_array = build_input_array(logical_len);
1183
1184 // create run array using input_array
1185 let mut builder = PrimitiveRunBuilder::<Int32Type, Int32Type>::new();
1186 builder.extend(input_array.clone().into_iter());
1187
1188 let run_array = builder.finish();
1189 let physical_values_array = run_array.values().as_primitive::<Int32Type>();
1190
1191 // create an array consisting of all the indices repeated twice and shuffled.
1192 let mut logical_indices: Vec<u32> = (0_u32..(logical_len as u32)).collect();
1193 // add same indices once more
1194 logical_indices.append(&mut logical_indices.clone());
1195 let mut rng = rng();
1196 logical_indices.shuffle(&mut rng);
1197
1198 let physical_indices = run_array.get_physical_indices(&logical_indices).unwrap();
1199
1200 assert_eq!(logical_indices.len(), physical_indices.len());
1201
1202 // check value in logical index in the input_array matches physical index in typed_run_array
1203 compare_logical_and_physical_indices(
1204 &logical_indices,
1205 &input_array,
1206 &physical_indices,
1207 physical_values_array,
1208 );
1209 }
1210 }
1211
1212 #[test]
1213 #[cfg_attr(miri, ignore)] // Takes too long

Callers

nothing calls this directly

Calls 10

collectMethod · 0.80
build_input_arrayFunction · 0.70
extendMethod · 0.45
into_iterMethod · 0.45
cloneMethod · 0.45
finishMethod · 0.45
valuesMethod · 0.45
appendMethod · 0.45
get_physical_indicesMethod · 0.45

Tested by

no test coverage detected