Skip to content

Commit

Permalink
migrate all tests to new Statistics min and max api
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-J-Ward committed Aug 9, 2024
1 parent 6950994 commit c65a773
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 88 deletions.
16 changes: 8 additions & 8 deletions parquet/src/arrow/arrow_writer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2544,11 +2544,11 @@ mod tests {
assert!(stats.has_min_max_set());
if let Statistics::Int32(stats) = stats {
assert_eq!(
*stats.min_unchecked() as u32,
*stats.min().unwrap() as u32,
*src_slice.iter().min().unwrap()
);
assert_eq!(
*stats.max_unchecked() as u32,
*stats.max().unwrap() as u32,
*src_slice.iter().max().unwrap()
);
} else {
Expand Down Expand Up @@ -2591,11 +2591,11 @@ mod tests {
assert!(stats.has_min_max_set());
if let Statistics::Int64(stats) = stats {
assert_eq!(
*stats.min_unchecked() as u64,
*stats.min().unwrap() as u64,
*src_slice.iter().min().unwrap()
);
assert_eq!(
*stats.max_unchecked() as u64,
*stats.max().unwrap() as u64,
*src_slice.iter().max().unwrap()
);
} else {
Expand Down Expand Up @@ -3081,8 +3081,8 @@ mod tests {

// Column chunk of column "a" should have chunk level statistics
if let Statistics::ByteArray(byte_array_stats) = a_col.statistics().unwrap() {
let min = byte_array_stats.min_unchecked();
let max = byte_array_stats.max_unchecked();
let min = byte_array_stats.min().unwrap();
let max = byte_array_stats.max().unwrap();

assert_eq!(min.as_bytes(), &[b'a']);
assert_eq!(max.as_bytes(), &[b'd']);
Expand Down Expand Up @@ -3153,8 +3153,8 @@ mod tests {

// Column chunk of column "a" should have chunk level statistics
if let Statistics::ByteArray(byte_array_stats) = a_col.statistics().unwrap() {
let min = byte_array_stats.min_unchecked();
let max = byte_array_stats.max_unchecked();
let min = byte_array_stats.min().unwrap();
let max = byte_array_stats.max().unwrap();

assert_eq!(min.as_bytes(), &[b'a']);
assert_eq!(max.as_bytes(), &[b'd']);
Expand Down
Loading

0 comments on commit c65a773

Please sign in to comment.