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

Function test_logical_nulls

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

Source from the content-addressed store, hash-verified

1277
1278 #[test]
1279 fn test_logical_nulls() {
1280 let run = Int32Array::from(vec![3, 6, 9, 12]);
1281 let values = Int32Array::from(vec![Some(0), None, Some(1), None]);
1282 let array = RunArray::try_new(&run, &values).unwrap();
1283
1284 let expected = [
1285 true, true, true, false, false, false, true, true, true, false, false, false,
1286 ];
1287
1288 let n = array.logical_nulls().unwrap();
1289 assert_eq!(n.null_count(), 6);
1290
1291 let slices = [(0, 12), (0, 2), (2, 5), (3, 0), (3, 3), (3, 4), (4, 8)];
1292 for (offset, length) in slices {
1293 let a = array.slice(offset, length);
1294 let n = a.logical_nulls().unwrap();
1295 let n = n.into_iter().collect::<Vec<_>>();
1296 assert_eq!(&n, &expected[offset..offset + length], "{offset} {length}");
1297 }
1298 }
1299
1300 #[test]
1301 fn test_run_array_eq_identical() {

Callers

nothing calls this directly

Calls 4

try_newFunction · 0.85
logical_nullsMethod · 0.45
sliceMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected