()
| 944 | |
| 945 | #[test] |
| 946 | fn test_sparse_union_is_null() { |
| 947 | // union of [{A=1}, {A=}, {B=3.2}, {B=}, {C="a"}, {C=}] |
| 948 | let int_array = Int32Array::from(vec![Some(1), None, None, None, None, None]); |
| 949 | let float_array = Float64Array::from(vec![None, None, Some(3.2), None, None, None]); |
| 950 | let str_array = StringArray::from(vec![None, None, None, None, Some("a"), None]); |
| 951 | let type_ids = [0, 0, 1, 1, 2, 2].into_iter().collect::<ScalarBuffer<i8>>(); |
| 952 | |
| 953 | let children = vec![ |
| 954 | Arc::new(int_array) as Arc<dyn Array>, |
| 955 | Arc::new(float_array), |
| 956 | Arc::new(str_array), |
| 957 | ]; |
| 958 | |
| 959 | let array = UnionArray::try_new(union_fields(), type_ids, None, children).unwrap(); |
| 960 | |
| 961 | let result = is_null(&array).unwrap(); |
| 962 | |
| 963 | let expected = &BooleanArray::from(vec![false, true, false, true, false, true]); |
| 964 | assert_eq!(expected, &result); |
| 965 | } |
| 966 | |
| 967 | fn union_fields() -> UnionFields { |
| 968 | [ |
nothing calls this directly
no test coverage detected