Dandandan opened a new pull request, #21977: URL: https://github.com/apache/datafusion/pull/21977
## Which issue does this PR close? N/A. ## Rationale for this change `GroupValuesPrimitive` stored hashes in the hash table. For single primitive group keys, storing the primitive value in the table lets hashbrown recompute hashes from the value and removes separate hash storage and values-vector lookups in the hot interning path. ## What changes are included in this PR? - Store `(group_index, value)` in `GroupValuesPrimitive` instead of `(group_index, hash)` plus a separate values vector. - Reconstruct emitted primitive arrays from hash table entries in group-index order. - Add focused `GroupValuesPrimitive_intern` benchmark cases and emit/reindex regression tests. ## Are these changes tested? Yes: - `cargo fmt --all` - `ci/scripts/rust_clippy.sh` - `cargo test -p datafusion-physical-plan --lib group_values` - `cargo test -p datafusion-physical-plan --lib primitive_emit` - `cargo clippy -p datafusion-physical-plan --features test_utils --bench aggregate_vectorized -- -D warnings` - `cargo clippy -p datafusion-physical-plan --lib --tests --features test_utils -- -D warnings` Benchmarks vs original stored-hash baseline: - `GroupValuesPrimitive_intern/low_cardinality`: 138.57 us -> 117.75 us (-15.48%) - `GroupValuesPrimitive_intern/high_cardinality`: 1.1006 ms -> 1.0879 ms (no statistically significant change) - `aggregate_query_group_by_u64 15 12`: 785.50 us -> 741.78 us (-5.06%) Note: `cargo clippy --all-targets --all-features -- -D warnings` currently fails in this workspace because `--all-features` enables both benchmark allocator features `snmalloc` and `mimalloc`; `ci/scripts/rust_clippy.sh` is the repository CI clippy command and passed. ## Are there any user-facing changes? No. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
