Skip to content

Commit

Permalink
Update partial_sort.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
berkaysynnada committed Dec 24, 2024
1 parent cc73190 commit 4d87779
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions datafusion/physical-plan/src/sorts/partial_sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,17 +374,14 @@ impl PartialSortStream {
self.in_mem_batches.push(batch.slice(0, slice_point));
let remaining_batch =
batch.slice(slice_point, batch.num_rows() - slice_point);
self.in_mem_batches.push(remaining_batch);

let sorted_batch = self.sort_in_mem_batches();
if sorted_batch
debug_assert!(sorted_batch
.as_ref()
.map(|batch| batch.num_rows() > 0)
.unwrap_or(true)
{
self.in_mem_batches.push(remaining_batch);
Some(sorted_batch)
} else {
None
}
.unwrap_or(true));
Some(sorted_batch)
} else {
self.in_mem_batches.push(batch);
continue;
Expand Down

0 comments on commit 4d87779

Please sign in to comment.