@@ -120,12 +120,13 @@ impl GroupValues for GroupValuesRows {
120
120
batch_hashes. resize ( n_rows, 0 ) ;
121
121
create_hashes ( cols, & self . random_state , batch_hashes) ?;
122
122
123
- for ( row, & hash ) in batch_hashes. iter ( ) . enumerate ( ) {
124
- let entry = self . map . get_mut ( hash , |( _hash , group_idx) | {
123
+ for ( row, & target_hash ) in batch_hashes. iter ( ) . enumerate ( ) {
124
+ let entry = self . map . get_mut ( target_hash , |( exist_hash , group_idx) | {
125
125
// verify that a group that we are inserting with hash is
126
126
// actually the same key value as the group in
127
127
// existing_idx (aka group_values @ row)
128
- group_rows. row ( row) == group_values. row ( * group_idx)
128
+ target_hash == * exist_hash
129
+ && group_rows. row ( row) == group_values. row ( * group_idx)
129
130
} ) ;
130
131
131
132
let group_idx = match entry {
@@ -139,7 +140,7 @@ impl GroupValues for GroupValuesRows {
139
140
140
141
// for hasher function, use precomputed hash value
141
142
self . map . insert_accounted (
142
- ( hash , group_idx) ,
143
+ ( target_hash , group_idx) ,
143
144
|( hash, _group_index) | * hash,
144
145
& mut self . map_size ,
145
146
) ;
0 commit comments