()
| 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() { |
nothing calls this directly
no test coverage detected