You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by su...@apache.org on 2022/02/22 17:04:00 UTC

[arrow-rs] branch master updated: Remove redundant has_ methods for optional column metadata fields (#1345)

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

sunchao 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 a69f0d1  Remove redundant has_ methods for optional column metadata fields (#1345)
a69f0d1 is described below

commit a69f0d119c67ef19e6a61acd24359de1b4ed2e10
Author: Shani Solomon <84...@users.noreply.github.com>
AuthorDate: Tue Feb 22 19:03:53 2022 +0200

    Remove redundant has_ methods for optional column metadata fields (#1345)
---
 parquet/src/file/metadata.rs          | 18 ------------------
 parquet/src/file/serialized_reader.rs |  2 --
 2 files changed, 20 deletions(-)

diff --git a/parquet/src/file/metadata.rs b/parquet/src/file/metadata.rs
index 49ac072..779b806 100644
--- a/parquet/src/file/metadata.rs
+++ b/parquet/src/file/metadata.rs
@@ -469,35 +469,17 @@ impl ColumnChunkMetaData {
         self.statistics.as_ref()
     }
 
-    /// Returns `true` if this column chunk contains page encoding stats, `false` otherwise.
-    pub fn has_page_encoding_stats(&self) -> bool {
-        self.encoding_stats.is_some()
-    }
-
     /// Returns the offset for the page encoding stats,
     /// or `None` if no page encoding stats are available.
     pub fn page_encoding_stats(&self) -> Option<&Vec<PageEncodingStats>> {
         self.encoding_stats.as_ref()
     }
 
-    /// Returns `true` if this column chunk contains a bloom filter offset, `false` otherwise.
-    pub fn has_bloom_filter(&self) -> bool {
-        self.bloom_filter_offset.is_some()
-    }
-
     /// Returns the offset for the bloom filter.
     pub fn bloom_filter_offset(&self) -> Option<i64> {
         self.bloom_filter_offset
     }
 
-    /// Returns `true` if this column chunk contains a column index, `false` otherwise.
-    pub fn has_column_index(&self) -> bool {
-        self.column_index_offset.is_some()
-            && self.column_index_length.is_some()
-            && self.offset_index_offset.is_some()
-            && self.offset_index_length.is_some()
-    }
-
     /// Returns the offset for the column index.
     pub fn column_index_offset(&self) -> Option<i64> {
         self.column_index_offset
diff --git a/parquet/src/file/serialized_reader.rs b/parquet/src/file/serialized_reader.rs
index 4d19be8..c91e832 100644
--- a/parquet/src/file/serialized_reader.rs
+++ b/parquet/src/file/serialized_reader.rs
@@ -773,7 +773,6 @@ mod tests {
         assert_eq!(col0_metadata.bloom_filter_offset().unwrap(), 192);
 
         // test page encoding stats
-        assert!(col0_metadata.has_page_encoding_stats());
         let page_encoding_stats =
             col0_metadata.page_encoding_stats().unwrap().get(0).unwrap();
 
@@ -782,7 +781,6 @@ mod tests {
         assert_eq!(page_encoding_stats.count, 1);
 
         // test optional column index offset
-        assert!(col0_metadata.has_column_index());
         assert_eq!(col0_metadata.column_index_offset().unwrap(), 156);
         assert_eq!(col0_metadata.column_index_length().unwrap(), 25);