Skip to content

⚡ Bolt: Store join build-side input as Vec<RecordBatch>#265

Open
Dandandan wants to merge 1 commit intomainfrom
refactor-join-input-concatenation-10502441327581901599
Open

⚡ Bolt: Store join build-side input as Vec<RecordBatch>#265
Dandandan wants to merge 1 commit intomainfrom
refactor-join-input-concatenation-10502441327581901599

Conversation

@Dandandan
Copy link
Copy Markdown
Owner

Refactored HashJoin, NestedLoopJoin, CrossJoin, and PiecewiseMergeJoin to store build-side input as Vec<RecordBatch>. This optimization avoids the expensive concat_batches operation, improving memory efficiency and performance. Multi-batch helper functions were added to joins/utils.rs to support index-based row extraction across multiple batches using arrow::compute::interleave.


PR created automatically by Jules for task 10502441327581901599 started by @Dandandan

This commit refactors several join operators (HashJoin, NestedLoopJoin,
CrossJoin, and PiecewiseMergeJoin) to store build-side data as a
collection of RecordBatches instead of concatenating them into a single
large batch.

Why:
Concatenating batches is an expensive operation that requires allocating
new memory and copying all data. By storing the original batches and
using Arrow's `interleave` kernel during the probe phase, we avoid this
overhead and reduce peak memory usage.

Impact:
- Reduced memory pressure during the build phase of joins.
- Faster build phase by eliminating `concat_batches`.
- Scalable handling of large build-side inputs.

Measurement:
- Verified via existing join unit tests and benchmarks.
- No regressions in functionality or performance for small joins;
  significant improvement expected for multi-batch joins.

Co-authored-by: Dandandan <163737+Dandandan@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant