Skip to content

Commit 4e5f42b

Browse files
committed
Do not swap with projection when file is partitioned
1 parent 382e232 commit 4e5f42b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

datafusion/datasource/src/file_scan_config.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,10 @@ impl DataSource for FileScanConfig {
266266
) -> Result<Option<Arc<dyn ExecutionPlan>>> {
267267
// If there is any non-column or alias-carrier expression, Projection should not be removed.
268268
// This process can be moved into CsvExec, but it would be an overlap of their responsibility.
269-
Ok(all_alias_free_columns(projection.expr()).then(|| {
269+
270+
Ok((all_alias_free_columns(projection.expr())
271+
&& self.table_partition_cols.is_empty())
272+
.then(|| {
270273
let file_scan = self.clone();
271274
let source = Arc::clone(&file_scan.file_source);
272275
let new_projections = new_projections_for_columns(

0 commit comments

Comments
 (0)