⚡ Bolt: Store join build-side input as Vec<RecordBatch>#265
⚡ Bolt: Store join build-side input as Vec<RecordBatch>#265
Conversation
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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Refactored HashJoin, NestedLoopJoin, CrossJoin, and PiecewiseMergeJoin to store build-side input as
Vec<RecordBatch>. This optimization avoids the expensiveconcat_batchesoperation, improving memory efficiency and performance. Multi-batch helper functions were added tojoins/utils.rsto support index-based row extraction across multiple batches usingarrow::compute::interleave.PR created automatically by Jules for task 10502441327581901599 started by @Dandandan