Repository navigation
Cherry-pick apache/datafusion#24418 - #184
Merged
LiaCastaneda merged 1 commit intoSep 16, 2026
Merged
LiaCastaneda merged 1 commit into
LiaCastaneda merged 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## branch-55 #184 +/- ##
==========================================
Coverage 81.18% 81.18%
==========================================
Files 1111 1111
Lines 387278 387293 +15
Branches 387278 387293 +15
==========================================
+ Hits 314396 314416 +20
+ Misses 54379 54371 -8
- Partials 18503 18506 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gabotechs
approved these changes
Sep 16, 2026
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes apache#123` indicates that this PR will close issue apache#123. --> - Closes apache#23921. - this PR was created on top of apache#24416, so once that is merged in we can rebase this branch ## Rationale for this change append_val is called once per new group on the scalar (streaming) code path. Previously it hashed a single-element slice of the dictionary values array on every call, paying create_hashes fixed overhead 65k times for a high-cardinality batch. Caching the full values array hash keyed on Arc::ptr_eq collapses that to one vectorized hash pass per batch, yielding a 2× speedup on the all-unique case with no measurable regression elsewhere. <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. Please explain the problem you are trying to solve in terms of the user-visible behavior, rather than the implementation. For example, "The code in `foo.rs` doesn't handle nulls" is a symptom of the implementation. "COUNT(DISTINCT) returns wrong results when the column contains nulls" is the user-visible problem. --> ## What changes are included in this PR? - DictionaryGroupValuesColumn gains a cached_values: Option<ArrayRef> field - append_val: on a cache miss (Arc::ptr_eq fails), hashes the entire dict.values() array into val_hashes and stores the Arc; on a hit, reuses val_hashes[val_idx] directly — eliminating the per-call slice(val_idx, 1) allocation and create_hashes call <!-- There is no need to duplicate the description in the issue here, but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? nothing logically changed. <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? no <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please add the `api change` label. --> --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> (cherry picked from commit 66a901f)
LiaCastaneda
force-pushed
the
lia.castaneda/cherry-pick/apache-pr-24418-20260916
branch
from
September 16, 2026 11:51
c77cc2d to
63d89aa
Compare
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.
cherry-picks apache#24418 onto branch-55, stacked on #183.
Depends on #183 (apache#23187, which creates
multi_group_by/dictionary.rs) landing first — this PR's diff will shrink to just this commit once #183 merges.Second prerequisite for cherry-picking apache#25185 onto branch-55: adds the
val_to_inner/val_hashesArc-pointer cache for the scalarappend_valpath that apache#25185 extends to the vectorized path.Auto-merged with no conflicts.
cargo check -p datafusion-physical-planandcargo test -p datafusion-physical-plan --lib aggregates::group_values(82/82) pass.