File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -451,6 +451,9 @@ impl Statistics {
451451
452452 /// Summarize zero or more statistics into a single `Statistics` instance.
453453 ///
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+ ///
454457 /// Returns an error if the statistics do not match the specified schemas.
455458 pub fn try_merge_iter < ' a , I > ( items : I , schema : & Schema ) -> Result < Statistics >
456459 where
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ mod tests {
269269 & self ,
270270 _file_col_statistics : & [ datafusion_common:: ColumnStatistics ] ,
271271 ) -> datafusion_common:: Result < Vec < datafusion_common:: ColumnStatistics > > {
272- todo ! ( )
272+ unimplemented ! ( )
273273 }
274274 }
275275}
Original file line number Diff line number Diff line change @@ -427,7 +427,7 @@ impl FileGroup {
427427
428428 /// Get the mutable reference to the statistics for this group
429429 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)
431431 }
432432
433433 /// Partition the list of files into `n` groups
Original file line number Diff line number Diff line change @@ -409,12 +409,16 @@ mod tests {
409409 let mut file_stats = Statistics :: default ( ) ;
410410
411411 // 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+ } ;
414416
415417 // 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+ } ;
418422
419423 file_stats. column_statistics = vec ! [ b_stats, a_stats] ;
420424
You can’t perform that action at this time.
0 commit comments