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 bcaa0b6bc [minor] use type aliases refine code. (#2161)
bcaa0b6bc is described below

commit bcaa0b6bc3f0ae9248d25af37b5cfed554b6fc71
Author: Yang Jiang <[email protected]>
AuthorDate: Mon Jul 25 20:35:27 2022 +0800

    [minor] use type aliases refine code. (#2161)
---
 parquet/src/file/metadata.rs | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/parquet/src/file/metadata.rs b/parquet/src/file/metadata.rs
index bffe538cc..58eaf7a8c 100644
--- a/parquet/src/file/metadata.rs
+++ b/parquet/src/file/metadata.rs
@@ -50,15 +50,18 @@ use crate::schema::types::{
     Type as SchemaType,
 };
 
+pub type ParquetColumnIndex = Vec<Vec<Index>>;
+pub type ParquetOffsetIndex = Vec<Vec<Vec<PageLocation>>>;
+
 /// Global Parquet metadata.
 #[derive(Debug, Clone)]
 pub struct ParquetMetaData {
     file_metadata: FileMetaData,
     row_groups: Vec<RowGroupMetaData>,
     /// Page index for all pages in each column chunk
-    page_indexes: Option<Vec<Vec<Index>>>,
+    page_indexes: Option<ParquetColumnIndex>,
     /// Offset index for all pages in each column chunk
-    offset_indexes: Option<Vec<Vec<Vec<PageLocation>>>>,
+    offset_indexes: Option<ParquetOffsetIndex>,
 }
 
 impl ParquetMetaData {
@@ -76,8 +79,8 @@ impl ParquetMetaData {
     pub fn new_with_page_index(
         file_metadata: FileMetaData,
         row_groups: Vec<RowGroupMetaData>,
-        page_indexes: Option<Vec<Vec<Index>>>,
-        offset_indexes: Option<Vec<Vec<Vec<PageLocation>>>>,
+        page_indexes: Option<ParquetColumnIndex>,
+        offset_indexes: Option<ParquetOffsetIndex>,
     ) -> Self {
         ParquetMetaData {
             file_metadata,
@@ -109,12 +112,12 @@ impl ParquetMetaData {
     }
 
     /// Returns page indexes in this file.
-    pub fn page_indexes(&self) -> Option<&Vec<Vec<Index>>> {
+    pub fn page_indexes(&self) -> Option<&ParquetColumnIndex> {
         self.page_indexes.as_ref()
     }
 
     /// Returns offset indexes in this file.
-    pub fn offset_indexes(&self) -> Option<&Vec<Vec<Vec<PageLocation>>>> {
+    pub fn offset_indexes(&self) -> Option<&ParquetOffsetIndex> {
         self.offset_indexes.as_ref()
     }
 }

Reply via email to