fix: avoid FixedSizeList overflow in hash join build materialization#21023
fix: avoid FixedSizeList overflow in hash join build materialization#21023kumarUjjawal wants to merge 2 commits intoapache:mainfrom
Conversation
|
run benchmarks |
|
🤖 Benchmark completed (GKE) | trigger Details
Resource Usagetpch — base (merge-base)
tpch — branch
|
|
there is an alternative approach here (still a bit messy code as I was experimenting around) Key points:
That at least avoids regressing TPC-H, still some small regressions on TPC-DS |
|
🤖 Benchmark completed (GKE) | trigger Details
Resource Usagetpcds — base (merge-base)
tpcds — branch
|
|
🤖 Benchmark completed (GKE) | trigger Details
Resource Usageclickbench_partitioned — base (merge-base)
clickbench_partitioned — branch
|
|
@Dandandan made the changes based on your feedback. The clickbench test seems to have a determinism issue, should I handle it here? |
|
run benchmarks |
Don't worry about clickbench - it does sometimes finish a bit more quickly than in other cases. But it doesn't have any joins. The regressions in tpcds_sf1 I also saw in my branch, would be nice to find out if we can minimize them (although I think it would be acceptable to have some low % losses for improving |
|
🤖 Benchmark completed (GKE) | trigger Details
Resource Usagetpch — base (merge-base)
tpch — branch
|
|
🤖 Benchmark completed (GKE) | trigger Details
Resource Usagetpcds — base (merge-base)
tpcds — branch
|
|
🤖 Benchmark completed (GKE) | trigger Details
Resource Usageclickbench_partitioned — base (merge-base)
clickbench_partitioned — branch
|
Which issue does this PR close?
Rationale for this change
Issue #20673 describes a panic in FULL OUTER JOIN when the build side includes a
FixedSizeListcolumn and the total element count exceedsu32::MAX.The problem was caused by
HashJoinExecconcatenating the entire build side into a single batch. For FixedSizeList, this leads totake()hitting Arrow’s internalu32indexing limit and panicking.The fix removes the single-batch assumption. Instead, the build side remains batched, and logical row indices are mapped back to their original batches. This avoids creating oversized
FixedSizeListArrayinstances and prevents the panic.What changes are included in this PR?
Fix this by keeping the build side in logical batch order instead of materializing one giant RecordBatch. Add batch-aware helpers for build-side row materialization, join-key equality checks, join filters, and final unmatched-row output, while preserving existing join semantics.
Also add regression coverage for large FixedSizeList build-side indices and unmatched-row output, unit tests for the new batch helpers.
Are these changes tested?
Yes
Are there any user-facing changes?