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

Function test_append_non_nulls

arrow-array/src/builder/struct_builder.rs:786–804  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

784
785 #[test]
786 fn test_append_non_nulls() {
787 let int_builder = Int32Builder::new();
788 let fields = vec![Field::new("f1", DataType::Int32, false)];
789 let field_builders = vec![Box::new(int_builder) as Box<dyn ArrayBuilder>];
790
791 let mut builder = StructBuilder::new(fields, field_builders);
792 builder
793 .field_builder::<Int32Builder>(0)
794 .unwrap()
795 .append_slice(&[1, 2, 3, 4, 5]);
796 builder.append_non_nulls(5);
797
798 let arr = builder.finish();
799 assert_eq!(arr.len(), 5);
800 assert_eq!(arr.null_count(), 0);
801 for i in 0..5 {
802 assert!(arr.is_valid(i));
803 }
804 }
805
806 #[test]
807 fn test_append_non_nulls_with_nulls() {

Callers

nothing calls this directly

Calls 3

append_non_nullsMethod · 0.80
append_sliceMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected