Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cargo fmt
Browse files Browse the repository at this point in the history
Michael-J-Ward committed Aug 9, 2024
1 parent 18b467b commit 7ffac1a
Showing 2 changed files with 64 additions and 12 deletions.
56 changes: 48 additions & 8 deletions parquet/src/arrow/arrow_reader/statistics.rs
Original file line number Diff line number Diff line change
@@ -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,
20 changes: 16 additions & 4 deletions parquet/src/arrow/arrow_writer/mod.rs
Original file line number Diff line number Diff line change
@@ -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")
}

0 comments on commit 7ffac1a

Please sign in to comment.