IN LIST: optimize Utf8View and BinaryView filters - #23016
Draft
geoffreyclaude wants to merge 4 commits into
Draft
Conversation
This was referenced Jun 18, 2026
geoffreyclaude
force-pushed
the
perf/in_list_string_view_filter
branch
2 times, most recently
from
June 18, 2026 09:31
34307af to
620f5e3
Compare
geoffreyclaude
force-pushed
the
perf/in_list_string_view_filter
branch
from
June 18, 2026 10:29
620f5e3 to
0adb66e
Compare
geoffreyclaude
force-pushed
the
perf/in_list_string_view_filter
branch
7 times, most recently
from
June 24, 2026 20:49
78183a9 to
2a2ab2c
Compare
geoffreyclaude
force-pushed
the
perf/in_list_string_view_filter
branch
9 times, most recently
from
June 30, 2026 07:44
3ea4041 to
23e5fa0
Compare
geoffreyclaude
force-pushed
the
perf/in_list_string_view_filter
branch
from
July 2, 2026 08:54
23e5fa0 to
4143b23
Compare
geoffreyclaude
force-pushed
the
perf/in_list_string_view_filter
branch
from
July 21, 2026 19:25
4143b23 to
7674831
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #23016 +/- ##
=======================================
Coverage ? 80.70%
=======================================
Files ? 1091
Lines ? 369879
Branches ? 369879
=======================================
Hits ? 298528
Misses ? 53523
Partials ? 17828 ☔ 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?
INperformance with specialized implementations #19390.Rationale for this change
Arrow
Utf8ViewandBinaryViewarrays store each value in a 128-bit view. Values up to 12 bytes are fully inline. Longer values keep their length and four-byte prefix in the view and store the remaining bytes separately.That representation allows cheap rejection without hashing or comparing complete strings. Inline values can be matched exactly from the view itself; long candidates are always confirmed against their full bytes before reporting a match.
What changes are included in this PR?
FrozenSet<u128>for larger inline lists.HashTablefor exact long-value confirmation.INandNOT INsemantics.Utf8View,BinaryView, nulls, long-prefix collisions, and custom hash collisions.Are these changes tested?
Yes.
cargo fmt --allcargo test -p datafusion-physical-expr --lib expressions::in_listcargo clippy --all-targets --all-features -- -D warnings./dev/rust_lint.shRUST_BACKTRACE=1 cargo test --profile ci --exclude datafusion-examples --exclude datafusion-benchmarks --exclude datafusion-cli --workspace --lib --tests --bins --features avro,json,backtrace,extended_tests,recursive_protection,parquet_encryptionAre there any user-facing changes?
No. This is an internal performance optimization only.
Local benchmark snapshot
Built and run in separate target directories, using identical benchmark source and filtering to the relevant byte-view rows:
Filters used:
utf8view/short_8b,utf8view/len_12b,utf8view/mixed_len, andnulls/utf8view/short_8b.Method: directly compared Criterion median point estimates. Filter construction remains outside the timed loop. Lower is better; changes within +/-5% are treated as noise.
Compared baselines: #23015 -> #23016
Relevant scope: all-inline
Utf8Viewrows, mixed inline/long shapes, the inline-dominant fallback, and nullable inline views.BinaryViewuses the same physical view representation and filter implementation.Summary: 23 relevant rows, 20 faster, 0 slower, 3 within +/-5%.
The inline-dominant mixed rows remain within noise, supporting the conservative fallback for that shape.
Largest relevant deltas:
nulls/utf8view/short_8b/list=16/match=50%/nulls=50%utf8view/short_8b/list=4/match=50%nulls/utf8view/short_8b/list=16/match=50%/nulls=20%/NOT_INnulls/utf8view/short_8b/list=16/match=50%/nulls=20%utf8view/short_8b/list=16/match=50%utf8view/short_8b/list=64/match=50%utf8view/len_12b/list=64/match=50%utf8view/short_8b/list=256/match=50%utf8view/len_12b/list=16/match=50%utf8view/short_8b/list=4/match=0%Full relevant table (23 rows)
utf8view/short_8b/list=4/match=0%utf8view/short_8b/list=4/match=50%utf8view/short_8b/list=16/match=0%utf8view/short_8b/list=16/match=50%utf8view/short_8b/list=64/match=0%utf8view/short_8b/list=64/match=50%utf8view/short_8b/list=256/match=0%utf8view/short_8b/list=256/match=50%utf8view/len_12b/list=16/match=0%utf8view/len_12b/list=16/match=50%utf8view/len_12b/list=64/match=0%utf8view/len_12b/list=64/match=50%utf8view/mixed_len/list=16/match=0%utf8view/mixed_len/list=16/match=50%utf8view/mixed_len/list=64/match=0%utf8view/mixed_len/list=64/match=50%utf8view/mixed_len/inline=2%/list=64/match=0%utf8view/mixed_len/inline=2%/list=64/match=50%utf8view/mixed_len/inline=98%/list=64/match=0%utf8view/mixed_len/inline=98%/list=64/match=50%nulls/utf8view/short_8b/list=16/match=50%/nulls=20%nulls/utf8view/short_8b/list=16/match=50%/nulls=20%/NOT_INnulls/utf8view/short_8b/list=16/match=50%/nulls=50%