You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2022/02/16 12:02:44 UTC

[arrow-rs] branch master updated: fix test bug and ensure that bloom filter metadata is serialized in `to_thrift` (#1320)

This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/master by this push:
     new 630b381  fix test bug and ensure that bloom filter metadata is serialized in `to_thrift` (#1320)
630b381 is described below

commit 630b381105ea8ba0849cf09e12406c6b6a084526
Author: Shani Solomon <84...@users.noreply.github.com>
AuthorDate: Wed Feb 16 14:02:38 2022 +0200

    fix test bug and ensure that bloom filter metadata is serialized in `to_thrift` (#1320)
    
    * fix test bug and cc metadata to_thrift
    
    * fmt
---
 parquet/src/file/metadata.rs | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/parquet/src/file/metadata.rs b/parquet/src/file/metadata.rs
index 6ae6667..8583b13 100644
--- a/parquet/src/file/metadata.rs
+++ b/parquet/src/file/metadata.rs
@@ -333,7 +333,7 @@ impl RowGroupMetaDataBuilder {
 }
 
 /// Metadata for a column chunk.
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, PartialEq)]
 pub struct ColumnChunkMetaData {
     column_type: Type,
     column_path: ColumnPath,
@@ -533,7 +533,7 @@ impl ColumnChunkMetaData {
             dictionary_page_offset: self.dictionary_page_offset,
             statistics: statistics::to_thrift(self.statistics.as_ref()),
             encoding_stats: None,
-            bloom_filter_offset: None,
+            bloom_filter_offset: self.bloom_filter_offset,
         };
 
         ColumnChunk {
@@ -739,17 +739,15 @@ mod tests {
             .set_total_uncompressed_size(3000)
             .set_data_page_offset(4000)
             .set_dictionary_page_offset(Some(5000))
+            .set_bloom_filter_offset(Some(6000))
             .build()
             .unwrap();
 
-        let col_chunk_exp = col_metadata.to_thrift();
-
         let col_chunk_res =
-            ColumnChunkMetaData::from_thrift(column_descr, col_chunk_exp.clone())
-                .unwrap()
-                .to_thrift();
+            ColumnChunkMetaData::from_thrift(column_descr, col_metadata.to_thrift())
+                .unwrap();
 
-        assert_eq!(col_chunk_res, col_chunk_exp);
+        assert_eq!(col_chunk_res, col_metadata);
     }
 
     #[test]