Skip to content

Commit 089b44a

Browse files
committed
fix: cargo fmt
1 parent faf5211 commit 089b44a

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

datafusion/common/src/stats.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,14 +1577,12 @@ mod tests {
15771577
let stats1 = Statistics::default()
15781578
.with_num_rows(Precision::Exact(10))
15791579
.add_column_statistics(
1580-
ColumnStatistics::new_unknown()
1581-
.with_distinct_count(Precision::Exact(5)),
1580+
ColumnStatistics::new_unknown().with_distinct_count(Precision::Exact(5)),
15821581
);
15831582
let stats2 = Statistics::default()
15841583
.with_num_rows(Precision::Exact(10))
15851584
.add_column_statistics(
1586-
ColumnStatistics::new_unknown()
1587-
.with_distinct_count(Precision::Exact(8)),
1585+
ColumnStatistics::new_unknown().with_distinct_count(Precision::Exact(8)),
15881586
);
15891587

15901588
let merged = stats1.try_merge(&stats2).unwrap();

datafusion/datasource-parquet/src/metadata.rs

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,7 @@ fn summarize_column_statistics(
560560
})
561561
.collect();
562562

563-
let coverage =
564-
distinct_counts.len() as f64 / num_row_groups.max(1) as f64;
563+
let coverage = distinct_counts.len() as f64 / num_row_groups.max(1) as f64;
565564

566565
if coverage < PARTIAL_NDV_THRESHOLD {
567566
Precision::Absent
@@ -1045,13 +1044,8 @@ mod tests {
10451044

10461045
let stats1 =
10471046
ParquetStatistics::int32(Some(1), Some(50), Some(15), Some(0), false);
1048-
let stats2 = ParquetStatistics::int32(
1049-
Some(51),
1050-
Some(100),
1051-
None,
1052-
Some(0),
1053-
false,
1054-
);
1047+
let stats2 =
1048+
ParquetStatistics::int32(Some(51), Some(100), None, Some(0), false);
10551049

10561050
let row_group1 =
10571051
create_row_group_with_stats(&schema_descr, vec![Some(stats1)], 500);
@@ -1078,15 +1072,32 @@ mod tests {
10781072
let schema_descr = create_schema_descr(1);
10791073
let arrow_schema = create_arrow_schema(1);
10801074

1081-
let stats_with =
1082-
|ndv| ParquetStatistics::int32(Some(1), Some(100), Some(ndv), Some(0), false);
1075+
let stats_with = |ndv| {
1076+
ParquetStatistics::int32(Some(1), Some(100), Some(ndv), Some(0), false)
1077+
};
10831078
let stats_without =
10841079
ParquetStatistics::int32(Some(1), Some(100), None, Some(0), false);
10851080

1086-
let rg1 = create_row_group_with_stats(&schema_descr, vec![Some(stats_with(10))], 250);
1087-
let rg2 = create_row_group_with_stats(&schema_descr, vec![Some(stats_with(20))], 250);
1088-
let rg3 = create_row_group_with_stats(&schema_descr, vec![Some(stats_with(15))], 250);
1089-
let rg4 = create_row_group_with_stats(&schema_descr, vec![Some(stats_without)], 250);
1081+
let rg1 = create_row_group_with_stats(
1082+
&schema_descr,
1083+
vec![Some(stats_with(10))],
1084+
250,
1085+
);
1086+
let rg2 = create_row_group_with_stats(
1087+
&schema_descr,
1088+
vec![Some(stats_with(20))],
1089+
250,
1090+
);
1091+
let rg3 = create_row_group_with_stats(
1092+
&schema_descr,
1093+
vec![Some(stats_with(15))],
1094+
250,
1095+
);
1096+
let rg4 = create_row_group_with_stats(
1097+
&schema_descr,
1098+
vec![Some(stats_without)],
1099+
250,
1100+
);
10901101
let metadata =
10911102
create_parquet_metadata(schema_descr, vec![rg1, rg2, rg3, rg4]);
10921103

0 commit comments

Comments
 (0)