| 566 | |
| 567 | #[test] |
| 568 | fn scatter_string_view_test() -> Result<()> { |
| 569 | let truthy = Arc::new(StringViewArray::from(vec![ |
| 570 | "short", |
| 571 | "a longer string that exceeds inline", |
| 572 | ])); |
| 573 | let mask = BooleanArray::from(vec![false, true, true, false]); |
| 574 | |
| 575 | let result = scatter(&mask, truthy.as_ref())?; |
| 576 | let result = result.as_any().downcast_ref::<StringViewArray>().unwrap(); |
| 577 | |
| 578 | assert_eq!(result.len(), 4); |
| 579 | assert!(result.is_null(0)); |
| 580 | assert_eq!(result.value(1), "short"); |
| 581 | assert_eq!(result.value(2), "a longer string that exceeds inline"); |
| 582 | assert!(result.is_null(3)); |
| 583 | Ok(()) |
| 584 | } |
| 585 | |
| 586 | #[test] |
| 587 | fn scatter_dictionary_test() -> Result<()> { |