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

Function test_gc_all_large

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

Source from the content-addressed store, hash-verified

1430 /// 3) All large values (> INLINE_LEN): each must be copied into the new data buffer
1431 #[test]
1432 fn test_gc_all_large() {
1433 let mut builder = StringViewBuilder::new().with_fixed_block_size(BLOCK_SIZE);
1434 let large_str = "X".repeat(MAX_INLINE_VIEW_LEN as usize + 5);
1435 // append multiple large strings
1436 for _ in 0..50 {
1437 builder.append_option(Some(&large_str));
1438 }
1439 let array = builder.finish();
1440 let gced = array.gc();
1441 // New data buffers should be populated (one or more blocks)
1442 assert!(
1443 !gced.data_buffers().is_empty(),
1444 "Expected data buffers for large values"
1445 );
1446 assert_eq!(gced.len(), 50);
1447 // verify that every large string emerges unchanged
1448 array.iter().zip(gced.iter()).for_each(|(orig, got)| {
1449 assert_eq!(orig, got, "Large view mismatch after gc");
1450 });
1451 }
1452
1453 /// 4) All null elements: ensure null bitmap handling path is correct
1454 #[test]

Callers

nothing calls this directly

Calls 6

with_fixed_block_sizeMethod · 0.80
gcMethod · 0.80
zipMethod · 0.80
append_optionMethod · 0.45
finishMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected