Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Nov 17, 2025

Which issue does this PR close?

  • Closes #.

Rationale for this change

Complete a TODO from #18630 (comment) from @Dandandan

// TODO: support push_batch_with_filter in LimitedBatchCoalescer

I am hoping to drive more optimizations into BatchCoalescer over time so I want to send as much through to the underlying arrow kernel as possible

What changes are included in this PR?

  1. Add LimitedBatchCoalescer::push_batch_with_filter
  2. Call it from FilterExec

Are these changes tested?

By existing CI

Are there any user-facing changes?

No

self.push_batch(filter_record_batch(&batch, filter)?)
} else {
// use optimized path when no fetch limit is set
self.inner.push_batch_with_filter(batch, filter)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the total_rows ? Does it need to be updated in the optimized path ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right -- I will try and fix this

batch: RecordBatch,
filter: &arrow::array::BooleanArray,
) -> Result<PushBatchStatus> {
// If there is a limit, fall back to the non-optimized path
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no check for self.finished as in push_batch().

@github-actions
Copy link

Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale PR has not had any activity for some time label Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-plan Changes to the physical-plan crate Stale PR has not had any activity for some time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants