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 4d87779 commit 2d7d793
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datafusion/physical-plan/src/sorts/partial_sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,11 @@ impl PartialSortStream {
self.in_mem_batches.push(batch.slice(0, slice_point));
let remaining_batch =
batch.slice(slice_point, batch.num_rows() - slice_point);
// Extract the sorted batch
let sorted_batch = self.sort_in_mem_batches();
// Refill with the remaining batch
self.in_mem_batches.push(remaining_batch);

let sorted_batch = self.sort_in_mem_batches();
debug_assert!(sorted_batch
.as_ref()
.map(|batch| batch.num_rows() > 0)
Expand Down

0 comments on commit 2d7d793

Please sign in to comment.