Repository navigation
Conversation
alamb
left a comment
There was a problem hiding this comment.
Thanks @rkrishn7 -- this looks much better to me -- see also #27499 (comment)
| impl GroupValues for GroupValuesRows { | ||
| fn intern(&mut self, cols: &[ArrayRef], groups: &mut Vec<usize>) -> Result<()> { | ||
| /// [`GroupValues::intern`] if `INSERT`, else [`GroupValues::lookup`]. | ||
| fn probe<const INSERT: bool>( |
There was a problem hiding this comment.
Yeah -- this looks good to me
GroupValues::lookupGroupValues::lookup
|
run benchmark multi_group_by dictionary_group_values ordered_group_values arrow_bytes_map clickbench_partitioned |
|
Hi @rkrishn7, thanks for the request (#27664 (comment)). Only whitelisted users can trigger benchmarks. Allowed users: 2010YOUY01, Dandandan, Fokko, HippoBaro, Jefffrey, Omega359, Rachelint, Rich-T-kid, adriangb, alamb, asubiotto, avantgardnerio, brunal, buraksenn, cetra3, codephage2020, coderfender, comphead, erenavsarogullari, etseidl, friendlymatthew, gabotechs, geoffreyclaude, grtlr, haohuaijin, jayzhan211, jonathanc-n, kevinjqliu, klion26, kosiew, kumarUjjawal, kunalsinghdadhwal, liamzwbao, mbutrovich, mkleen, mzabaluev, neilconway, rluvaton, sdf-jkl, timsaucer, xudong963, zhuqi-lucas. File an issue against this benchmark runner |
|
Ah could we please trigger benchmarks for I'm also running some local microbenchmarks that cover more cc @jayzhan211 |
|
@jayzhan211 re: benchmarks, I had Claude run some local benchmarks against Each case measures
|
Which issue does this PR close?
GroupValues::find#27498.Rationale for this change
See #27498 and the discussion in #27499. This replaces #27499 with a smaller change:
lookupshares each implementation's probe code withintern, so only the no-insert branches are new.What changes are included in this PR?
GroupValues::lookup, which works likeinternbut never stores a new key. A row whose key is not stored getsMISSING_GROUP.GroupValues::supports_lookup, likesupports_values_preserving. By defaultlookupreturns a not-implemented error andsupports_lookupreturnsfalse, so an implementation can opt out.interninto a privateprobe::<const INSERT: bool>, which bothinternandlookupcall. The flag is a const generic, sointernhas no extra per-row branch.GroupValuesPrimitive,GroupValuesBoolean,GroupValuesBytes,GroupValuesBytesView,GroupValuesRowsandGroupValuesColumn.ArrowBytesMapandArrowBytesViewMapget the same treatment and a publicfind, which backs the bytes implementations.GroupValuesClusteredhas no hash table, so it does not supportlookup.What is the testing strategy for this PR?
Assertions in existing tests check that
lookupreturns the same idsinternassigned, returnsMISSING_GROUPfor missing keys, and leaveslen()unchanged. This includes lookups afteremitandclear_shrink. The tests also pass withforce_hash_collisions.Are there any user-facing changes?
No changes to query behavior. New public API, with no breaking changes:
GroupValues::lookupandGroupValues::supports_lookup, with defaultsMISSING_GROUPinaggregates::group_valuesArrowBytesMap::findandArrowBytesViewMap::findindatafusion-physical-expr-common