Skip to content

Commit

Permalink
Move schema projection to where it's used in ListingTable (#11167)
Browse files Browse the repository at this point in the history
adriangb authored Jun 28, 2024
1 parent f1360b8 commit 09b3c73
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions datafusion/core/src/datasource/listing/table.rs
Original file line number Diff line number Diff line change
@@ -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)));
}

0 comments on commit 09b3c73

Please sign in to comment.