IN LIST: centralize primitive filters and optimize Decimal128 - #24283
Draft
geoffreyclaude wants to merge 3 commits into
Draft
IN LIST: centralize primitive filters and optimize Decimal128#24283geoffreyclaude wants to merge 3 commits into
geoffreyclaude wants to merge 3 commits into
Conversation
Move primitive strategy selection beside the filter implementations. Primitive arrays and representation adapters share the same branchless cutoffs and bitmap/hash-set fallbacks. Reuse PrimitiveHashSetFilter and SQL result construction across native integer filters.
Route Decimal128 lists above the branchless cutoff through PrimitiveHashSetFilter, replacing the ArrayStaticFilter fallback. Add tests for SQL null propagation, NOT IN, dictionary needles, and compatible decimal metadata.
This was referenced Aug 12, 2026
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24283 +/- ##
==========================================
+ Coverage 80.91% 81.28% +0.36%
==========================================
Files 1102 1110 +8
Lines 377102 385235 +8133
Branches 377102 385235 +8133
==========================================
+ Hits 305143 313143 +8000
+ Misses 53769 53596 -173
- Partials 18190 18496 +306 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Which issue does this PR close?
Rationale for this change
#23014 adds fast direct comparisons for short primitive
INlists. For longer lists, DataFusion uses a bitmap, a hash set, or another specialized filter when one exists, and otherwise uses the general filter.#24102 needs to make that same choice after reading
FixedSizeBinaryvalues as same-width primitive keys. Today, the choice is part of the native primitive path, so #24102 would have to repeat its limits and fallback rules.This PR moves that choice beside the primitive filters and makes it reusable. The limits count only non-null list values. It also combines the separate
Int32,Int64,UInt32, andUInt64hash-set filters into one implementation. Other existing primitive types keep the same behavior.The only new lookup path is for
Decimal128. Lists with at most four non-null values still use direct comparisons. Larger lists now use a hash set over the storedi128values instead of the general Arrow filter. Values are not rescaled, and the existing precision, scale, and null rules are unchanged. #24102 also uses this path for 16-byteFixedSizeBinaryvalues.What changes are included in this PR?
PrimitiveHashSetFilter<T>and reuses the shared SQL result builder.Decimal128lists with more than four non-null values.Decimal128benchmark cases at list sizes 5 and 64.Are these changes tested?
Tests cover the direct-comparison boundary, an all-null list, and the larger
Decimal128path with hits, misses, a null in the list,IN,NOT IN, dictionary inputs, and compatible precision/scale metadata.Are there any user-facing changes?
No. SQL results and public APIs are unchanged.
Benchmark snapshot
The benchmark uses list size 5, the first size above the direct-comparison limit, and a larger size of 64. Each size is measured with 0% and 50% matches. Filter construction is outside the timed loop.
A previous automated run measured these code states before this work was split from #24102. The split did not change the
Decimal128implementation on either side.Compared baselines: #23014 -> this PR
primitive/decimal128/large_list/list=5/match=0%primitive/decimal128/large_list/list=5/match=50%primitive/decimal128/large_list/list=64/match=0%primitive/decimal128/large_list/list=64/match=50%