We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7b3f18 commit 7758889Copy full SHA for 7758889
arrow-select/src/coalesce.rs
@@ -315,7 +315,12 @@ impl BatchCoalescer {
315
let to_copy = remaining.min(space_in_batch);
316
317
// Find how many filter positions we need to cover `to_copy` set bits
318
- let chunk_len = find_nth_set_bit_position(filter, filter_pos, to_copy) - filter_pos;
+ // Skip the expensive search if all remaining rows fit in the current batch
319
+ let chunk_len = if remaining <= space_in_batch {
320
+ filter.len() - filter_pos
321
+ } else {
322
+ find_nth_set_bit_position(filter, filter_pos, to_copy) - filter_pos
323
+ };
324
325
let chunk_filter = filter.slice(filter_pos, chunk_len);
326
let mut filter_builder = FilterBuilder::new(&chunk_filter);
0 commit comments