fatemehp commented on code in PR #14603:
URL: https://github.com/apache/arrow/pull/14603#discussion_r1049244693


##########
cpp/src/parquet/column_reader.cc:
##########
@@ -386,6 +395,28 @@ std::shared_ptr<Page> SerializedPageReader::NextPage() {
       throw ParquetException("Invalid page header");
     }
 
+    const PageType::type page_type = LoadEnumSafe(&current_page_header_.type);
+    const bool is_data_page =
+        page_type == PageType::DATA_PAGE || page_type == 
PageType::DATA_PAGE_V2;
+
+    // Once we have the header, we will call the skip_page_call_back_ to
+    // determine if we should be skipping this page. If yes, we will advance 
the
+    // stream to the next page.
+    if (skip_page_callback_ && is_data_page) {
+      std::variant<format::DataPageHeader, format::DataPageHeaderV2> 
data_page_header;
+      if (page_type == PageType::DATA_PAGE) {
+        data_page_header = current_page_header_.data_page_header;
+      } else {
+        data_page_header = current_page_header_.data_page_header_v2;
+      }
+      std::unique_ptr<DataPageStats> data_page_stats =

Review Comment:
   I think the caller should check that the stats are valid before setting a 
callback function.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to