From 7ffac1a967f96afe855a53194e80f3e7dd953574 Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Fri, 9 Aug 2024 03:13:48 -0500 Subject: [PATCH] cargo fmt --- parquet/src/arrow/arrow_reader/statistics.rs | 56 +++++++++++++++++--- parquet/src/arrow/arrow_writer/mod.rs | 20 +++++-- 2 files changed, 64 insertions(+), 12 deletions(-) diff --git a/parquet/src/arrow/arrow_reader/statistics.rs b/parquet/src/arrow/arrow_reader/statistics.rs index a66f42fddfb2..98d327b50b11 100644 --- a/parquet/src/arrow/arrow_reader/statistics.rs +++ b/parquet/src/arrow/arrow_reader/statistics.rs @@ -141,14 +141,54 @@ make_stats_iterator!( ParquetStatistics::Boolean, bool ); -make_stats_iterator!(MinInt32StatsIterator, min_unchecked, ParquetStatistics::Int32, i32); -make_stats_iterator!(MaxInt32StatsIterator, max_unchecked, ParquetStatistics::Int32, i32); -make_stats_iterator!(MinInt64StatsIterator, min_unchecked, ParquetStatistics::Int64, i64); -make_stats_iterator!(MaxInt64StatsIterator, max_unchecked, ParquetStatistics::Int64, i64); -make_stats_iterator!(MinFloatStatsIterator, min_unchecked, ParquetStatistics::Float, f32); -make_stats_iterator!(MaxFloatStatsIterator, max_unchecked, ParquetStatistics::Float, f32); -make_stats_iterator!(MinDoubleStatsIterator, min_unchecked, ParquetStatistics::Double, f64); -make_stats_iterator!(MaxDoubleStatsIterator, max_unchecked, ParquetStatistics::Double, f64); +make_stats_iterator!( + MinInt32StatsIterator, + min_unchecked, + ParquetStatistics::Int32, + i32 +); +make_stats_iterator!( + MaxInt32StatsIterator, + max_unchecked, + ParquetStatistics::Int32, + i32 +); +make_stats_iterator!( + MinInt64StatsIterator, + min_unchecked, + ParquetStatistics::Int64, + i64 +); +make_stats_iterator!( + MaxInt64StatsIterator, + max_unchecked, + ParquetStatistics::Int64, + i64 +); +make_stats_iterator!( + MinFloatStatsIterator, + min_unchecked, + ParquetStatistics::Float, + f32 +); +make_stats_iterator!( + MaxFloatStatsIterator, + max_unchecked, + ParquetStatistics::Float, + f32 +); +make_stats_iterator!( + MinDoubleStatsIterator, + min_unchecked, + ParquetStatistics::Double, + f64 +); +make_stats_iterator!( + MaxDoubleStatsIterator, + max_unchecked, + ParquetStatistics::Double, + f64 +); make_stats_iterator!( MinByteArrayStatsIterator, min_bytes, diff --git a/parquet/src/arrow/arrow_writer/mod.rs b/parquet/src/arrow/arrow_writer/mod.rs index 70fadd5ae996..21972812f056 100644 --- a/parquet/src/arrow/arrow_writer/mod.rs +++ b/parquet/src/arrow/arrow_writer/mod.rs @@ -2543,8 +2543,14 @@ mod tests { let stats = column.statistics().unwrap(); assert!(stats.has_min_max_set()); if let Statistics::Int32(stats) = stats { - assert_eq!(*stats.min_unchecked() as u32, *src_slice.iter().min().unwrap()); - assert_eq!(*stats.max_unchecked() as u32, *src_slice.iter().max().unwrap()); + assert_eq!( + *stats.min_unchecked() as u32, + *src_slice.iter().min().unwrap() + ); + assert_eq!( + *stats.max_unchecked() as u32, + *src_slice.iter().max().unwrap() + ); } else { panic!("Statistics::Int32 missing") } @@ -2584,8 +2590,14 @@ mod tests { let stats = column.statistics().unwrap(); assert!(stats.has_min_max_set()); if let Statistics::Int64(stats) = stats { - assert_eq!(*stats.min_unchecked() as u64, *src_slice.iter().min().unwrap()); - assert_eq!(*stats.max_unchecked() as u64, *src_slice.iter().max().unwrap()); + assert_eq!( + *stats.min_unchecked() as u64, + *src_slice.iter().min().unwrap() + ); + assert_eq!( + *stats.max_unchecked() as u64, + *src_slice.iter().max().unwrap() + ); } else { panic!("Statistics::Int64 missing") }