Repository navigation
bench: expand dictionary group-by coverage - #25303
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25303 +/- ##
========================================
Coverage 82.58% 82.58%
========================================
Files 1142 1142
Lines 440930 441236 +306
Branches 440930 441236 +306
========================================
+ Hits 364126 364397 +271
- Misses 54801 54825 +24
- Partials 22003 22014 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
67df706 to
5fb6054
Compare
|
Rebased onto current |
|
I will try and take a look sometime this week/weekend |
kosiew
left a comment
There was a problem hiding this comment.
Thanks for expanding the benchmark coverage. The new inputs cover the main representation, NDV, value-width, batch-layout, and dictionary-reuse dimensions needed to gather data for a future cost-based policy, and I did not find any blocking issues in this change.
|
@yinli-systems you may be interested in this PR #26250, its not in a merge-able state but the results will be very useful when creating #24117 |
Which issue does this PR close?
Rationale for this change
The existing dictionary benchmark only measures pre-encoded dictionaries with cardinality expressed as a fraction of row count. That is not enough to derive a safe automatic encoding policy: native dictionaries, per-batch dictionaries,
Utf8View, plain strings, and runtime encoding have materially different costs, and the crossover also depends on absolute NDV, value width, and batch layout.I rebased this PR onto current
mainafter #25185 merged and reran the relevant matrix, so the evidence includes the new cached dictionary-value-hash path. The crossover remains clear; the cache optimization does not make dictionary grouping universally profitable.Current-main results (
700ad9cf2, release/LTO, Apple M5 Max, Rust 1.98.1; 10M rows, 8,192-row input batches, one target partition; median of iterations 2-6 after two warmups; output normalized back toUtf8):Utf8ViewThese are local measurements, not a proposed universal threshold. They show why #24117 needs a cost decision based on absolute NDV and value width rather than a blanket dictionary rewrite. Runtime encoding also lost in every earlier measured case, which is why the planned optimizer work targets native Parquet dictionary reads rather than inserting a runtime cast.
What changes are included in this PR?
Utf8View, plain strings, and runtime dictionary casts.Utf8in the output so output-type preservation is included in the measurement.This PR only establishes the benchmark surface needed to evaluate #24117; it does not add an optimizer rule or select a universal threshold.
What is the testing strategy for this PR?
On rebased head
5fb605471:cargo test -p datafusion-benchmarks --lib(153 passed)cargo test -p datafusion-benchmarks --lib --no-default-features(153 passed)cargo clippy -p datafusion-benchmarks --all-targets --no-deps -- -D warningscargo clippy -p datafusion-benchmarks --all-targets --all-features --no-deps -- -D warningscargo fmt --all -- --checkAre there any user-facing changes?
No DataFusion runtime or public API behavior changes. This only adds benchmark CLI controls.