()
| 4913 | /// Test unnesting a non-nullable list. |
| 4914 | #[tokio::test] |
| 4915 | async fn unnest_non_nullable_list() -> Result<()> { |
| 4916 | let list_array = ListArray::from_iter_primitive::<Int32Type, _, _>(vec![ |
| 4917 | Some(vec![Some(1), Some(2)]), |
| 4918 | Some(vec![None]), |
| 4919 | ]); |
| 4920 | let schema = Arc::new(Schema::new(vec![Field::new( |
| 4921 | "c1", |
| 4922 | DataType::new_list(DataType::Int32, true), |
| 4923 | false, |
| 4924 | )])); |
| 4925 | |
| 4926 | let batch = RecordBatch::try_new(schema, vec![Arc::new(list_array)])?; |
| 4927 | let ctx = SessionContext::new(); |
| 4928 | let results = ctx |
| 4929 | .read_batches(vec![batch])? |
| 4930 | .unnest_columns(&["c1"])? |
| 4931 | .collect() |
| 4932 | .await?; |
| 4933 | |
| 4934 | assert_snapshot!( |
| 4935 | batches_to_string(&results), |
| 4936 | @r" |
| 4937 | +----+ |
| 4938 | | c1 | |
| 4939 | +----+ |
| 4940 | | 1 | |
| 4941 | | 2 | |
| 4942 | | | |
| 4943 | +----+ |
| 4944 | " |
| 4945 | ); |
| 4946 | |
| 4947 | Ok(()) |
| 4948 | } |
| 4949 | |
| 4950 | #[tokio::test] |
| 4951 | async fn test_read_batches() -> Result<()> { |
nothing calls this directly
no test coverage detected
searching dependent graphs…