From a1edaa0eefbb503fe4595d286c4484a977d50f91 Mon Sep 17 00:00:00 2001 From: wiedld Date: Thu, 29 Aug 2024 07:48:35 -0700 Subject: [PATCH] test: proof that once https://github.com/apache/datafusion/pull/12032 merges, the PR for https://github.com/apache/datafusion/pull/12232 will solve the issue --- .../src/datasource/physical_plan/parquet/mod.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/datafusion/core/src/datasource/physical_plan/parquet/mod.rs b/datafusion/core/src/datasource/physical_plan/parquet/mod.rs index 6c310ef882b9..de03dc1548e9 100644 --- a/datafusion/core/src/datasource/physical_plan/parquet/mod.rs +++ b/datafusion/core/src/datasource/physical_plan/parquet/mod.rs @@ -2090,11 +2090,8 @@ mod tests { Ok(()) } - /// parquet's get_data_page_statistics is not yet implemented - /// for view types. - #[should_panic(expected = "not implemented")] #[tokio::test] - async fn test_struct_filter_parquet_with_view_types() { + async fn test_struct_filter_parquet_with_view_types() -> Result<()> { let tmp_dir = TempDir::new().unwrap(); let path = tmp_dir.path().to_str().unwrap().to_string() + "/test.parquet"; write_file(&path); @@ -2110,7 +2107,17 @@ mod tests { .await .unwrap(); let sql = "select * from base_table where name='test02'"; - let _ = ctx.sql(sql).await.unwrap().collect().await.unwrap(); + let batch = ctx.sql(sql).await.unwrap().collect().await.unwrap(); + assert_eq!(batch.len(), 1); + let expected = [ + "+---------------------+----+--------+", + "| struct | id | name |", + "+---------------------+----+--------+", + "| {id: 4, name: aaa2} | 2 | test02 |", + "+---------------------+----+--------+", + ]; + crate::assert_batches_eq!(expected, &batch); + Ok(()) } fn write_file(file: &String) {