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

Function test_create_struct_array_nested_nullability

arrow/src/util/data_gen.rs:754–780  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

752
753 #[test]
754 fn test_create_struct_array_nested_nullability() {
755 let struct_child_fields = vec![
756 Field::new("null_int", DataType::Int32, true),
757 Field::new("int", DataType::Int32, false),
758 ];
759 let struct_field = Field::new_struct("not_null_struct", struct_child_fields, false);
760
761 let struct_array = create_random_array(&struct_field, 100, 0.95, 0.5).unwrap();
762
763 assert_eq!(struct_array.null_count(), 0);
764 assert!(
765 struct_array
766 .as_struct()
767 .column_by_name("null_int")
768 .unwrap()
769 .null_count()
770 > 0
771 );
772 assert_eq!(
773 struct_array
774 .as_struct()
775 .column_by_name("int")
776 .unwrap()
777 .null_count(),
778 0
779 );
780 }
781
782 #[test]
783 fn test_create_list_array_nested_struct_nullability() {

Callers

nothing calls this directly

Calls 1

create_random_arrayFunction · 0.85

Tested by

no test coverage detected