File tree 1 file changed +9
-7
lines changed
datafusion/functions-aggregate-common/src/aggregate/groups_accumulator
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -118,16 +118,18 @@ where
118
118
values,
119
119
opt_filter,
120
120
total_num_groups,
121
- |block_ids, block_offsets, row_offsets, row_idxs | {
121
+ |block_ids, block_offsets, row_offsets, val_row_idxs | {
122
122
let iter = block_ids. iter ( ) . zip ( row_offsets. windows ( 2 ) ) ;
123
123
for ( & block_id, row_bound) in iter {
124
124
let block = & mut self . values [ block_id as usize ] ;
125
- ( row_bound[ 0 ] ..row_bound[ 1 ] ) . for_each ( |idx| {
126
- let block_offset = block_offsets[ idx] ;
127
- let value = & mut block[ block_offset as usize ] ;
128
- let value_row_idx = row_idxs[ idx] ;
129
- ( self . prim_fn ) ( value, data[ value_row_idx] ) ;
130
- } ) ;
125
+ let beg = row_bound[ 0 ] ;
126
+ let end = row_bound[ 1 ] ;
127
+ let blk_offsets_iter = block_offsets[ beg..end] . iter ( ) ;
128
+ let val_row_idxs_iter = val_row_idxs[ beg..end] . iter ( ) ;
129
+ for ( & blk_offset, & val_row_idx) in blk_offsets_iter. zip ( val_row_idxs_iter) {
130
+ let value = & mut block[ blk_offset as usize ] ;
131
+ ( self . prim_fn ) ( value, data[ val_row_idx] ) ;
132
+ }
131
133
}
132
134
} ,
133
135
) ;
You can’t perform that action at this time.
0 commit comments