bench: expand dictionary group-by coverage - #25303
Open
yinli-systems wants to merge 2 commits into
Open
yinli-systems wants to merge 2 commits into
yinli-systems wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25303 +/- ##
========================================
Coverage 81.91% 81.92%
========================================
Files 1134 1134
Lines 425708 426014 +306
Branches 425708 426014 +306
========================================
+ Hits 348726 349004 +278
- Misses 56305 56321 +16
- Partials 20677 20689 +12 ☔ 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
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.The initial benchmark evidence is recorded in #24117 (comment). Runtime encoding lost in every measured case, while pre-encoded dictionaries changed from a substantial win at low NDV to a loss at higher NDV.
A follow-up using
Utf8View, the relevant default Parquet scan representation, confirmed that NDV ratio and value width must be considered together. With 10M rows and 8,192-row batches, a per-batch dictionary was roughly 18% faster thanUtf8Viewfor 16-byte values and 37% faster for 64-byte values at NDV 1,000. At NDV 10,000 it was roughly 67% and 44% slower, respectively. These are local measurements rather than a proposed universal threshold.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?
cargo test -p datafusion-benchmarks --lib(148 passed)cargo test -p datafusion-benchmarks --lib --no-default-features(148 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 -- --checkUtf8ViewCLI runs with fixed NDV, input batching, value width, and output normalizationA full transitive clippy run currently stops on the pre-existing
unused_async_trait_impllint indatafusion/datasource-parquet/src/opener/encryption.rsafter the Rust 1.98 toolchain update; the benchmark crate itself is clean with both default and all features.Are there any user-facing changes?
No DataFusion runtime or public API behavior changes. This only adds benchmark CLI controls.