rluvaton commented on code in PR #25107:
URL: https://github.com/apache/datafusion/pull/25107#discussion_r3978146769
##########
datafusion/physical-plan/src/sorts/stream.rs:
##########
@@ -377,13 +377,15 @@ impl Iterator for IncrementalSortIterator {
}
fn size_hint(&self) -> (usize, Option<usize>) {
- let num_rows = self.batch.num_rows();
+ let num_rows = self.batch.num_rows().saturating_sub(self.cursor);
let batch_size = self.batch_size;
let num_batches = num_rows.div_ceil(batch_size);
(num_batches, Some(num_batches))
}
}
+impl ExactSizeIterator for IncrementalSortIterator {}
Review Comment:
great catch, thanks, fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]