Skip to content

Commit df1db6a

Browse files
committed
fix clippy
1 parent f1bbb1d commit df1db6a

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

datafusion/common/src/stats.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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

datafusion/core/src/datasource/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

datafusion/datasource/src/file_groups.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

datafusion/datasource/src/schema_adapter.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)