18
18
//! Utilities for implementing GroupsAccumulator
19
19
//! Adapter that makes [`GroupsAccumulator`] out of [`Accumulator`]
20
20
21
- use std:: mem:: { size_of, size_of_val} ;
21
+ use std:: mem:: size_of;
22
+ // use std::mem::size_of_val; // TODO: Remove commented Accumulator::size() code?
22
23
23
24
use crate :: arrow_datafusion_err;
24
25
use crate :: error:: { DataFusionError , Result } ;
@@ -189,8 +190,8 @@ impl<AccumulatorType: Accumulator> GroupsAccumulatorFlatAdapter<AccumulatorType>
189
190
"asserting values[0].len() == group_indices.len()"
190
191
) ;
191
192
192
- let mut sizes_pre = 0 ;
193
- let mut sizes_post = 0 ;
193
+ // let mut sizes_pre = 0;
194
+ // let mut sizes_post = 0;
194
195
for offsets in offsets_param. windows ( 2 ) {
195
196
let group_idx = group_indices[ offsets[ 0 ] ] ;
196
197
let accumulator: & mut AccumulatorType = & mut self . accumulators [ group_idx] ;
@@ -271,8 +272,8 @@ impl<AccumulatorType: Accumulator> GroupsAccumulatorFlatAdapter<AccumulatorType>
271
272
// RecordBatch(es)
272
273
let iter = groups_with_rows. iter ( ) . zip ( offsets. windows ( 2 ) ) ;
273
274
274
- let mut sizes_pre = 0 ;
275
- let mut sizes_post = 0 ;
275
+ // let mut sizes_pre = 0;
276
+ // let mut sizes_post = 0;
276
277
for ( & group_idx, offsets) in iter {
277
278
// sizes_pre += state.size(); // TODO: Add Accumulator::size?
278
279
@@ -373,7 +374,7 @@ impl<AccumulatorType: Accumulator> GroupsAccumulator
373
374
374
375
let results: Vec < ScalarValue > = accumulators
375
376
. into_iter ( )
376
- . map ( |mut accumulator| {
377
+ . map ( |accumulator| {
377
378
// self.free_allocation(state.size()); // TODO: Add Accumulator::size?
378
379
accumulator. evaluate ( )
379
380
} )
@@ -400,7 +401,7 @@ impl<AccumulatorType: Accumulator> GroupsAccumulator
400
401
// which we need to form into columns
401
402
let mut results: Vec < Vec < ScalarValue > > = vec ! [ ] ;
402
403
403
- for mut accumulator in accumulators {
404
+ for accumulator in accumulators {
404
405
// self.free_allocation(state.size()); // TODO: Add Accumulator::size?
405
406
let accumulator_state = accumulator. state ( ) ?;
406
407
results. resize_with ( accumulator_state. len ( ) , Vec :: new) ;
0 commit comments