This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 09b3c7342c Move schema projection to where it's used in ListingTable 
(#11167)
09b3c7342c is described below

commit 09b3c7342c982a60f2828a98380ea249e6110fc1
Author: Adrian Garcia Badaracco <[email protected]>
AuthorDate: Fri Jun 28 12:38:26 2024 -0500

    Move schema projection to where it's used in ListingTable (#11167)
---
 datafusion/core/src/datasource/listing/table.rs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/datafusion/core/src/datasource/listing/table.rs 
b/datafusion/core/src/datasource/listing/table.rs
index 74aca82b3e..b2e81b87fa 100644
--- a/datafusion/core/src/datasource/listing/table.rs
+++ b/datafusion/core/src/datasource/listing/table.rs
@@ -744,10 +744,9 @@ impl TableProvider for ListingTable {
         let (mut partitioned_file_lists, statistics) =
             self.list_files_for_scan(state, filters, limit).await?;
 
-        let projected_schema = project_schema(&self.schema(), projection)?;
-
         // if no files need to be read, return an `EmptyExec`
         if partitioned_file_lists.is_empty() {
+            let projected_schema = project_schema(&self.schema(), projection)?;
             return Ok(Arc::new(EmptyExec::new(projected_schema)));
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to