@@ -191,8 +191,8 @@ impl ParquetAccessPlan {
191
191
/// Note there is no entry for the (entirely) skipped row group 1.
192
192
///
193
193
/// [`ArrowReaderBuilder::with_row_selection`]: parquet::arrow::arrow_reader::ArrowReaderBuilder::with_row_selection
194
- pub fn overall_row_selection (
195
- & self ,
194
+ pub fn into_overall_row_selection (
195
+ self ,
196
196
row_group_meta_data : & [ RowGroupMetaData ] ,
197
197
) -> Option < RowSelection > {
198
198
assert_eq ! ( row_group_meta_data. len( ) , self . row_groups. len( ) ) ;
@@ -206,7 +206,7 @@ impl ParquetAccessPlan {
206
206
207
207
let total_selection: RowSelection = self
208
208
. row_groups
209
- . iter ( )
209
+ . into_iter ( )
210
210
. zip ( row_group_meta_data. iter ( ) )
211
211
. flat_map ( |( rg, rg_meta) | {
212
212
match rg {
@@ -216,8 +216,7 @@ impl ParquetAccessPlan {
216
216
vec ! [ RowSelector :: select( rg_meta. num_rows( ) as usize ) ]
217
217
}
218
218
RowGroupAccess :: Selection ( selection) => {
219
- // todo avoid these clones
220
- let selection: Vec < RowSelector > = selection. clone ( ) . into ( ) ;
219
+ let selection: Vec < RowSelector > = selection. into ( ) ;
221
220
selection
222
221
}
223
222
}
@@ -353,7 +352,7 @@ mod test {
353
352
row_group_access : Vec < RowGroupAccess > ,
354
353
) -> Option < RowSelection > {
355
354
let access_plan = ParquetAccessPlan :: new ( row_group_access) ;
356
- access_plan. overall_row_selection ( row_group_metadata ( ) )
355
+ access_plan. into_overall_row_selection ( row_group_metadata ( ) )
357
356
}
358
357
359
358
static ROW_GROUP_METADATA : OnceLock < Vec < RowGroupMetaData > > = OnceLock :: new ( ) ;
0 commit comments