bert-beyondloops commented on code in PR #19785:
URL: https://github.com/apache/datafusion/pull/19785#discussion_r2686280638
##########
datafusion/physical-plan/src/filter.rs:
##########
@@ -802,37 +802,22 @@ impl Stream for FilterExecStream {
})?;
timer.done();
- if let LimitReached = status {
- poll = self.flush_remaining_batches();
- break;
- }
-
- if let Some(batch) =
self.batch_coalescer.next_completed_batch() {
- self.metrics.selectivity.add_part(batch.num_rows());
- poll = Poll::Ready(Some(Ok(batch)));
- break;
- }
- continue;
- }
- None => {
- // Flush any remaining buffered batch
- match self.batch_coalescer.finish() {
- Ok(()) => {
- poll = self.flush_remaining_batches();
+ match status {
+ PushBatchStatus::Continue => {
+ // Keep pushing more batches
}
- Err(e) => {
- poll = Poll::Ready(Some(Err(e)));
+ LimitReached => {
Review Comment:
changed.
##########
datafusion/physical-plan/src/filter.rs:
##########
@@ -802,37 +802,22 @@ impl Stream for FilterExecStream {
})?;
timer.done();
- if let LimitReached = status {
- poll = self.flush_remaining_batches();
- break;
- }
-
- if let Some(batch) =
self.batch_coalescer.next_completed_batch() {
- self.metrics.selectivity.add_part(batch.num_rows());
- poll = Poll::Ready(Some(Ok(batch)));
- break;
- }
- continue;
- }
- None => {
- // Flush any remaining buffered batch
- match self.batch_coalescer.finish() {
- Ok(()) => {
- poll = self.flush_remaining_batches();
+ match status {
+ PushBatchStatus::Continue => {
+ // Keep pushing more batches
}
- Err(e) => {
- poll = Poll::Ready(Some(Err(e)));
+ LimitReached => {
+ // limit was reached, so stop early
+ self.batch_coalescer.finish()?
Review Comment:
changed.
--
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]