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

Function test_append_nulls

arrow-array/src/builder/map_builder.rs:475–497  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

473
474 #[test]
475 fn test_append_nulls() {
476 let mut builder = MapBuilder::new(None, Int32Builder::new(), Int32Builder::new());
477
478 builder.keys().append_value(1);
479 builder.values().append_value(100);
480 builder.append(true).unwrap();
481
482 builder.append_nulls(3).unwrap();
483
484 builder.keys().append_value(2);
485 builder.values().append_value(200);
486 builder.append(true).unwrap();
487
488 let map = builder.finish();
489 assert_eq!(map.len(), 5);
490 assert_eq!(map.null_count(), 3);
491 assert!(map.is_valid(0));
492 assert!(map.is_null(1));
493 assert!(map.is_null(2));
494 assert!(map.is_null(3));
495 assert!(map.is_valid(4));
496 assert_eq!(map.value_offsets(), &[0, 1, 1, 1, 1, 2]);
497 }
498
499 #[test]
500 fn test_append_nulls_inconsistent_state() {

Callers

nothing calls this directly

Calls 6

append_valueMethod · 0.45
keysMethod · 0.45
valuesMethod · 0.45
appendMethod · 0.45
append_nullsMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected