From fa6ca02f7271ea5c8ddc313cf46ca5b2fa9b5d79 Mon Sep 17 00:00:00 2001 From: Neville Dipale Date: Thu, 8 Oct 2020 17:08:59 +0200 Subject: [PATCH] ARROW-10225: [Rust] [Parquet] Fix null comparison in roundtrip Closes #8388 from nevi-me/ARROW-10225 Authored-by: Neville Dipale Signed-off-by: Neville Dipale --- rust/parquet/src/arrow/arrow_writer.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rust/parquet/src/arrow/arrow_writer.rs b/rust/parquet/src/arrow/arrow_writer.rs index 40e2553e2ea2d..a17e4244d3566 100644 --- a/rust/parquet/src/arrow/arrow_writer.rs +++ b/rust/parquet/src/arrow/arrow_writer.rs @@ -724,7 +724,11 @@ mod tests { assert_eq!(expected_data.offset(), actual_data.offset()); assert_eq!(expected_data.buffers(), actual_data.buffers()); assert_eq!(expected_data.child_data(), actual_data.child_data()); - assert_eq!(expected_data.null_bitmap(), actual_data.null_bitmap()); + // Null counts should be the same, not necessarily bitmaps + // A null bitmap is optional if an array has no nulls + if expected_data.null_count() != 0 { + assert_eq!(expected_data.null_bitmap(), actual_data.null_bitmap()); + } } } @@ -1001,7 +1005,7 @@ mod tests { } #[test] - #[ignore] // Binary support isn't correct yet - null_bitmap doesn't match + #[ignore] // Binary support isn't correct yet - buffers don't match fn binary_single_column() { let one_vec: Vec = (0..SMALL_SIZE as u8).collect(); let many_vecs: Vec<_> = std::iter::repeat(one_vec).take(SMALL_SIZE).collect(); @@ -1026,7 +1030,6 @@ mod tests { } #[test] - #[ignore] // String support isn't correct yet - null_bitmap doesn't match fn string_single_column() { let raw_values: Vec<_> = (0..SMALL_SIZE).map(|i| i.to_string()).collect(); let raw_strs = raw_values.iter().map(|s| s.as_str()); @@ -1035,7 +1038,6 @@ mod tests { } #[test] - #[ignore] // Large string support isn't correct yet - null_bitmap doesn't match fn large_string_single_column() { let raw_values: Vec<_> = (0..SMALL_SIZE).map(|i| i.to_string()).collect(); let raw_strs = raw_values.iter().map(|s| s.as_str());