Skip to content

Commit cca5f0f

Browse files
committed
fix again
1 parent 1a66604 commit cca5f0f

File tree

1 file changed

+5
-4
lines changed
  • datafusion/core/src/datasource/physical_plan

1 file changed

+5
-4
lines changed

datafusion/core/src/datasource/physical_plan/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,11 @@ fn get_projected_output_ordering(
452452
) -> Vec<Vec<PhysicalSortExpr>> {
453453
let mut all_orderings = vec![];
454454
for output_ordering in &base_config.output_ordering {
455-
// Check if all file groups are sorted
456-
if base_config.file_groups.iter().all(|group| {
455+
// Check if any file groups are not sorted
456+
if base_config.file_groups.iter().any(|group| {
457457
if group.len() <= 1 {
458-
return true;
458+
// File groups with <= 1 files are always sorted
459+
return false;
459460
}
460461

461462
let statistics = match MinMaxStatistics::new_from_files(
@@ -471,7 +472,7 @@ fn get_projected_output_ordering(
471472
}
472473
};
473474

474-
statistics.is_sorted()
475+
!statistics.is_sorted()
475476
}) {
476477
debug!(
477478
"Skipping specified output ordering {:?}. \

0 commit comments

Comments
 (0)