File tree 1 file changed +7
-7
lines changed
datafusion/core/src/datasource 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -258,28 +258,28 @@ pub fn compute_all_files_statistics(
258
258
collect_stats : bool ,
259
259
inexact_stats : bool ,
260
260
) -> Result < ( Vec < FileGroup > , Statistics ) > {
261
- let mut file_groups = file_groups;
261
+ let mut file_groups_with_stats = Vec :: with_capacity ( file_groups. len ( ) ) ;
262
262
263
263
// First compute statistics for each file group
264
- for file_group in file_groups. iter_mut ( ) {
265
- * file_group = compute_file_group_statistics (
266
- file_group. clone ( ) ,
264
+ for file_group in file_groups {
265
+ file_groups_with_stats . push ( compute_file_group_statistics (
266
+ file_group,
267
267
Arc :: clone ( & file_schema) ,
268
268
collect_stats,
269
- ) ?;
269
+ ) ?) ;
270
270
}
271
271
272
272
// Then summary statistics across all file groups
273
273
let mut statistics =
274
- compute_summary_statistics ( & file_groups , & file_schema, |file_group| {
274
+ compute_summary_statistics ( & file_groups_with_stats , & file_schema, |file_group| {
275
275
file_group. statistics ( )
276
276
} ) ;
277
277
278
278
if inexact_stats {
279
279
statistics = statistics. to_inexact ( )
280
280
}
281
281
282
- Ok ( ( file_groups , statistics) )
282
+ Ok ( ( file_groups_with_stats , statistics) )
283
283
}
284
284
285
285
pub ( crate ) fn add_row_stats (
You can’t perform that action at this time.
0 commit comments