()
| 620 | |
| 621 | #[test] |
| 622 | fn test_struct_array_builder() { |
| 623 | let boolean_array = BooleanArray::from(vec![false, false, true, true]); |
| 624 | let int_array = Int64Array::from(vec![42, 28, 19, 31]); |
| 625 | |
| 626 | let fields = vec![ |
| 627 | Field::new("a", DataType::Boolean, false), |
| 628 | Field::new("b", DataType::Int64, false), |
| 629 | ]; |
| 630 | let struct_array_data = ArrayData::builder(DataType::Struct(fields.into())) |
| 631 | .len(4) |
| 632 | .add_child_data(boolean_array.to_data()) |
| 633 | .add_child_data(int_array.to_data()) |
| 634 | .build() |
| 635 | .unwrap(); |
| 636 | let struct_array = StructArray::from(struct_array_data); |
| 637 | |
| 638 | assert_eq!(struct_array.column(0).as_ref(), &boolean_array); |
| 639 | assert_eq!(struct_array.column(1).as_ref(), &int_array); |
| 640 | } |
| 641 | |
| 642 | #[test] |
| 643 | fn test_struct_array_from() { |
nothing calls this directly
no test coverage detected