You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "mapleFU (via GitHub)" <gi...@apache.org> on 2023/06/01 12:38:29 UTC

[GitHub] [arrow-rs] mapleFU commented on a diff in pull request #4326: Add separate row_count and level_count to PageMetadata (#4321)

mapleFU commented on code in PR #4326:
URL: https://github.com/apache/arrow-rs/pull/4326#discussion_r1213087653


##########
parquet/src/column/page.rs:
##########
@@ -277,18 +278,27 @@ impl TryFrom<&PageHeader> for PageMetadata {
 
     fn try_from(value: &PageHeader) -> std::result::Result<Self, Self::Error> {
         match value.type_ {
-            crate::format::PageType::DATA_PAGE => Ok(PageMetadata {
-                num_rows: value.data_page_header.as_ref().unwrap().num_values as usize,
-                is_dict: false,
-            }),
+            crate::format::PageType::DATA_PAGE => {
+                let header = value.data_page_header.as_ref().unwrap();
+                Ok(PageMetadata {
+                    num_rows: None,
+                    num_levels: Some(header.num_values as _),

Review Comment:
   I guess when page `max_def_level == 0`, `num_values` doesn't means `num_levels`? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org