File tree 4 files changed +13
-6
lines changed
4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -451,6 +451,9 @@ impl Statistics {
451
451
452
452
/// Summarize zero or more statistics into a single `Statistics` instance.
453
453
///
454
+ /// The method assumes that all statistics are for the same schema.
455
+ /// If not, maybe you can call `SchemaMapper::map_column_statistics` to make them consistent.
456
+ ///
454
457
/// Returns an error if the statistics do not match the specified schemas.
455
458
pub fn try_merge_iter < ' a , I > ( items : I , schema : & Schema ) -> Result < Statistics >
456
459
where
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ mod tests {
269
269
& self ,
270
270
_file_col_statistics : & [ datafusion_common:: ColumnStatistics ] ,
271
271
) -> datafusion_common:: Result < Vec < datafusion_common:: ColumnStatistics > > {
272
- todo ! ( )
272
+ unimplemented ! ( )
273
273
}
274
274
}
275
275
}
Original file line number Diff line number Diff line change @@ -427,7 +427,7 @@ impl FileGroup {
427
427
428
428
/// Get the mutable reference to the statistics for this group
429
429
pub fn statistics_mut ( & mut self ) -> Option < & mut Statistics > {
430
- self . statistics . as_mut ( ) . map ( |arc| Arc :: make_mut ( arc ) )
430
+ self . statistics . as_mut ( ) . map ( Arc :: make_mut)
431
431
}
432
432
433
433
/// Partition the list of files into `n` groups
Original file line number Diff line number Diff line change @@ -409,12 +409,16 @@ mod tests {
409
409
let mut file_stats = Statistics :: default ( ) ;
410
410
411
411
// Statistics for column b (index 0 in file)
412
- let mut b_stats = ColumnStatistics :: default ( ) ;
413
- b_stats. null_count = Precision :: Exact ( 5 ) ;
412
+ let b_stats = ColumnStatistics {
413
+ null_count : Precision :: Exact ( 5 ) ,
414
+ ..Default :: default ( )
415
+ } ;
414
416
415
417
// Statistics for column a (index 1 in file)
416
- let mut a_stats = ColumnStatistics :: default ( ) ;
417
- a_stats. null_count = Precision :: Exact ( 10 ) ;
418
+ let a_stats = ColumnStatistics {
419
+ null_count : Precision :: Exact ( 10 ) ,
420
+ ..Default :: default ( )
421
+ } ;
418
422
419
423
file_stats. column_statistics = vec ! [ b_stats, a_stats] ;
420
424
You can’t perform that action at this time.
0 commit comments