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

Function test_gc_all_nulls

arrow-array/src/array/byte_view_array.rs:1455–1470  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1453 /// 4) All null elements: ensure null bitmap handling path is correct
1454 #[test]
1455 fn test_gc_all_nulls() {
1456 let mut builder = StringViewBuilder::new().with_fixed_block_size(BLOCK_SIZE);
1457 for _ in 0..20 {
1458 builder.append_null();
1459 }
1460 let array = builder.finish();
1461 let gced = array.gc();
1462 // length and null count match
1463 assert_eq!(gced.len(), 20);
1464 assert_eq!(gced.null_count(), 20);
1465 // data buffers remain empty for null-only array
1466 assert!(
1467 gced.data_buffers().is_empty(),
1468 "No data should be stored for nulls"
1469 );
1470 }
1471
1472 /// 5) Random mix of inline, large, and null values with slicing tests
1473 #[test]

Callers

nothing calls this directly

Calls 4

with_fixed_block_sizeMethod · 0.80
gcMethod · 0.80
append_nullMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected