refactor join-key equality filtering#23843
Open
shehab-ali wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23843 +/- ##
=======================================
Coverage ? 80.75%
=======================================
Files ? 1089
Lines ? 368883
Branches ? 368883
=======================================
Hits ? 297885
Misses ? 53248
Partials ? 17750 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
shehab-ali
marked this pull request as ready for review
July 23, 2026 20:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
related to #23237
Simplified and sped up candidate-pair equality filtering by eliminating per-row type dispatch and by using a pre-built comparator that respects
NullEqualitysemantics.Added targeted hash-join microbenchmarks to exercise high-fanout and single hot bucket join cases with long string keys and multi column keys.
Description
Before this change, hash join probing produced candidate build/probe row-index pairs and then equal_rows_arr validated those pairs by materializing temporary key arrays, comparing those arrays, building a boolean mask, and filtering the candidate indices.
After this change,
equal_rows_arrvalidates candidate pairs by comparing the original key arrays directly by row index usingJoinKeyComparator, then appending only matching candidate indices to the output arrays. It also now checks that the input shapes are valid before doing that work.Where This Happens in Hash Join
During hash join probing, DataFusion first asks the join hash map for candidate build/probe index pairs. Those pairs are still “candidate” matches because the hash table is based on hash values, so DataFusion must confirm that the actual join-key values are equal.
Before
After
This should particularly help workloads where:
Benchmark Performance
The new Q24 and Q25 benchmarks were created to make this behavior visible:
These benchmarks are meant to show whether future changes improve this exact candidate-pair validation path which replicate the hot partition case, not just generic hash join performance.
Testing
cargo testand the new teststest_equal_rows_arr_filters_candidate_pairsandtest_equal_rows_arr_respects_null_equalitypassed.