Skip to content

fix: handle empty IEJoin outer fill#19604

Open
sundy-li wants to merge 1 commit intodatabendlabs:mainfrom
sundy-li:fix/issue-19569-iejoin-empty-result-20260324-1925
Open

fix: handle empty IEJoin outer fill#19604
sundy-li wants to merge 1 commit intodatabendlabs:mainfrom
sundy-li:fix/issue-19569-iejoin-empty-result-20260324-1925

Conversation

@sundy-li
Copy link
Member

@sundy-li sundy-li commented Mar 24, 2026

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  • avoid IEJoin outer-fill panics when the unmatched inner side produced no data blocks
  • build null-padded outer rows from the range-join output schema instead of indexing an empty inner block vector
  • add a direct unit regression plus SQL/integration coverage for empty-input outer IEJoin cases

Changes

  1. Store the range-join output schema in RangeJoinState.
  2. Update fill_outer() to derive the null-padded inner columns from the output schema slices for left/right joins.
  3. Add a unit test that reproduces the reported out-of-bounds panic with an empty inner block vector.
  4. Add SQL execution coverage and a sqllogictest file for outer IEJoin queries with empty inputs.

Tests

  • cargo test -p databend-query test_fill_outer_with_empty_inner_table_blocks --lib -- --nocapture
  • cargo test -p databend-query --test it test_iejoin_outer_join_with_empty_input -- --nocapture
  • cargo clippy -p databend-query --lib -- -D warnings

Type of change

  • Bug fix

Fixes #19569


This change is Reviewable

@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2026

At least one test kind must be checked in the PR description.
@sundy-li please update it 🙏.

@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Mar 24, 2026
@sundy-li sundy-li added agent-reviewable Ready for agent review agent-approved Approved by agent and removed agent-reviewable Ready for agent review labels Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-approved Approved by agent pr-bugfix this PR patches a bug in codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IEJoin (range join) index out of bounds on empty result

1 participant