IN LIST: Handle dictionary inputs once - #24662
Conversation
Cover plain and dictionary Int32 inputs from one row through the standard 8,192-row batch. The cases use both short and longer IN lists so fixed per-batch costs are visible without losing the usual vectorized comparison.
df02fd2 to
7055e43
Compare
|
run benchmark in_list |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing codex/in-list-dictionary-dispatch (7055e43) to c396e6a diff Run configurationrun benchmark in_list
baseline:
ref: "c396e6ae465a96725363e7715702d140ca97a2ca"Results will be posted here when complete File an issue against this benchmark runner |
Wrap the selected filter when the input is dictionary encoded, instead of teaching every filter implementation how to unpack dictionary keys. Plain inputs continue to use their filter directly. Flatten nested dictionary values before choosing a filter, and cover dictionary key types, nested dictionaries, nulls, timestamps, decimals, and scalar inputs.
7055e43 to
33a3f38
Compare
|
run benchmark in_list |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing codex/in-list-dictionary-dispatch (33a3f38) to c396e6a diff Run configurationrun benchmark in_list
baseline:
ref: "c396e6ae465a96725363e7715702d140ca97a2ca"Results will be posted here when complete File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: Comparing codex/in-list-dictionary-dispatch (7055e43) to c396e6a diff Run configurationrun benchmark in_list
baseline:
ref: "c396e6ae465a96725363e7715702d140ca97a2ca"CPU Details (lscpu)Details
Resource Usagein_list — base (merge-base)
in_list — branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: Comparing codex/in-list-dictionary-dispatch (33a3f38) to c396e6a diff Run configurationrun benchmark in_list
baseline:
ref: "c396e6ae465a96725363e7715702d140ca97a2ca"CPU Details (lscpu)Details
Resource Usagein_list — base (merge-base)
in_list — branch
File an issue against this benchmark runner |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24662 +/- ##
==========================================
+ Coverage 81.32% 81.43% +0.11%
==========================================
Files 1117 1120 +3
Lines 396269 399920 +3651
Branches 396269 399920 +3651
==========================================
+ Hits 322260 325690 +3430
+ Misses 55186 55178 -8
- Partials 18823 19052 +229 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
run benchmark in_list_strategy |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing codex/in-list-dictionary-dispatch (33a3f38) to c396e6a diff Run configurationrun benchmark in_list_strategy
baseline:
ref: "c396e6ae465a96725363e7715702d140ca97a2ca"Results will be posted here when complete File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: Comparing codex/in-list-dictionary-dispatch (33a3f38) to c396e6a diff Run configurationrun benchmark in_list_strategy
baseline:
ref: "c396e6ae465a96725363e7715702d140ca97a2ca"CPU Details (lscpu)Details
Resource Usagein_list_strategy — base (merge-base)
in_list_strategy — branch
File an issue against this benchmark runner |
|
❤️ |
Which issue does this PR close?
Rationale for this change
Dictionary handling is currently repeated in each concrete
IN LISTfilter. That makesdatafusion-physical-exprsubstantially larger to compile and link.What changes are included in this PR?
Dictionary-encoded inputs use one small wrapper around the selected filter. The filter checks each dictionary value once, then maps those results through the dictionary keys. Plain inputs continue to call their selected filter directly.
Nested dictionary list values are flattened before choosing a filter. This preserves SQL null behavior while still allowing the final value type to use its specialized filter.
The PR also adds small-batch Criterion cases for both plain and dictionary inputs.
Measurements
Measured locally on an M1 Max against the exact #24102 head plus the benchmark-only commit.
datafusion-physical-exprLLVM IRStaticFilter::containsLLVM IR__textFocused Criterion benchmarks found no material regression. In the automated AArch64 run, dictionary inputs had 15–26% lower latency at batch sizes 1–64, while 8,192-row and plain-input cases were unchanged (full results).
Are these changes tested?
Yes. Tests cover every dictionary key type, nested dictionaries, dictionary nulls, unreferenced null values, timestamp timezones, decimal metadata, and nested dictionary scalar inputs.
cargo test -p datafusion-physical-expr --all-features(1,694 passed, 1 ignored; 13 doctests passed)cargo clippy --all-targets --all-features -- -D warningscargo fmt --allAre there any user-facing changes?
No. This keeps the existing
IN LISTbehavior while reducing generated code.