Skip to content

Commit

Permalink
fix again
Browse files Browse the repository at this point in the history
  • Loading branch information
suremarc committed Mar 15, 2024
1 parent 1a66604 commit cca5f0f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions datafusion/core/src/datasource/physical_plan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,11 @@ fn get_projected_output_ordering(
) -> Vec<Vec<PhysicalSortExpr>> {
let mut all_orderings = vec![];
for output_ordering in &base_config.output_ordering {
// Check if all file groups are sorted
if base_config.file_groups.iter().all(|group| {
// Check if any file groups are not sorted
if base_config.file_groups.iter().any(|group| {
if group.len() <= 1 {
return true;
// File groups with <= 1 files are always sorted
return false;
}

let statistics = match MinMaxStatistics::new_from_files(
Expand All @@ -471,7 +472,7 @@ fn get_projected_output_ordering(
}
};

statistics.is_sorted()
!statistics.is_sorted()
}) {
debug!(
"Skipping specified output ordering {:?}. \
Expand Down

0 comments on commit cca5f0f

Please sign in to comment.