⚡ Bolt: Optimize HashJoinExec for single-batch build side#253
⚡ Bolt: Optimize HashJoinExec for single-batch build side#253google-labs-jules[bot] wants to merge 1 commit intomainfrom
Conversation
This optimization adds a fast path to the `HashJoinExec` build phase. It avoids calling the expensive `concat_batches` function when the build-side input stream consists of only a single `RecordBatch`. This is a common scenario, and bypassing this step reduces CPU and memory usage during the join's build phase. Additionally, this change fixes a pre-existing test failure (`spill::tests::test_spill_compression`) by enabling the `zstd` feature for the `arrow-ipc` crate in the root `Cargo.toml`.
|
👋 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. |
💡 What: This optimization adds a fast path to the
HashJoinExecbuild phase. It avoids calling the expensiveconcat_batchesfunction when the build-side input stream consists of only a singleRecordBatch.🎯 Why: The
concat_batchesfunction introduces unnecessary overhead (memory allocation, data copying) when the build side is already a single batch. This is a common scenario, and bypassing this step reduces CPU and memory usage.📊 Impact: Improves hash join performance for single-batch build inputs by reducing memory allocation and CPU overhead.
🔬 Measurement: The improvement can be observed in benchmarks where the build side of a hash join is a single batch. This change makes the execution more efficient for this common case. I also fixed a pre-existing unrelated test failure by enabling the
zstdfeature for thearrow-ipccrate.PR created automatically by Jules for task 8066934054533340668 started by @Dandandan