@@ -25,6 +25,7 @@ use std::collections::BinaryHeap;
2525use std:: iter:: repeat_with;
2626use std:: mem;
2727use std:: ops:: { Index , IndexMut } ;
28+ use std:: sync:: Arc ;
2829
2930/// Repartition input files into `target_partitions` partitions, if total file size exceed
3031/// `repartition_file_min_size`
@@ -368,7 +369,7 @@ pub struct FileGroup {
368369 /// The files in this group
369370 files : Vec < PartitionedFile > ,
370371 /// Optional statistics for the data across all files in the group
371- statistics : Option < Statistics > ,
372+ statistics : Option < Arc < Statistics > > ,
372373}
373374
374375impl FileGroup {
@@ -386,7 +387,7 @@ impl FileGroup {
386387 }
387388
388389 /// Set the statistics for this group
389- pub fn with_statistics ( mut self , statistics : Statistics ) -> Self {
390+ pub fn with_statistics ( mut self , statistics : Arc < Statistics > ) -> Self {
390391 self . statistics = Some ( statistics) ;
391392 self
392393 }
@@ -420,7 +421,7 @@ impl FileGroup {
420421
421422 /// Get the statistics for this group
422423 pub fn statistics ( & self ) -> Option < & Statistics > {
423- self . statistics . as_ref ( )
424+ self . statistics . as_deref ( )
424425 }
425426
426427 /// Partition the list of files into `n` groups
0 commit comments