From 8d960bf7a3d099e5d67925e4e1c4c647466eef7b Mon Sep 17 00:00:00 2001 From: Xiangpeng Hao Date: Thu, 25 Jul 2024 18:33:00 -0400 Subject: [PATCH] use inferenced schema, don't load schema again --- .../core/src/datasource/physical_plan/parquet/opener.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/datafusion/core/src/datasource/physical_plan/parquet/opener.rs b/datafusion/core/src/datasource/physical_plan/parquet/opener.rs index ffe879eb8de0..b6dfa4569ee9 100644 --- a/datafusion/core/src/datasource/physical_plan/parquet/opener.rs +++ b/datafusion/core/src/datasource/physical_plan/parquet/opener.rs @@ -92,7 +92,9 @@ impl FileOpener for ParquetOpener { let limit = self.limit; Ok(Box::pin(async move { - let options = ArrowReaderOptions::new().with_page_index(enable_page_index); + let options = ArrowReaderOptions::new() + .with_page_index(enable_page_index) + .with_schema(table_schema.clone()); let mut builder = ParquetRecordBatchStreamBuilder::new_with_options(reader, options) .await?;