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

[GitHub] [arrow] wjones127 commented on a diff in pull request #34112: GH-34138: [C++][Parquet] Fix parsing stats from min_value/max_value

wjones127 commented on code in PR #34112:
URL: https://github.com/apache/arrow/pull/34112#discussion_r1109065285


##########
cpp/src/parquet/column_reader.cc:
##########
@@ -211,10 +211,15 @@ EncodedStatistics ExtractStatsFromHeader(const H& header) {
     return page_statistics;
   }
   const format::Statistics& stats = header.statistics;
-  if (stats.__isset.max) {
+  // Use the new V2 min-max statistics over the former one if it is filled
+  if (stats.__isset.max_value && stats.__isset.min_value) {
+    // TODO: check if the column_order is TYPE_DEFINED_ORDER.
+    page_statistics.set_max(stats.max_value);
+    page_statistics.set_min(stats.min_value);

Review Comment:
   ```suggestion
     if (stats.__isset.max_value || stats.__isset.min_value) {
       // TODO: check if the column_order is TYPE_DEFINED_ORDER.
       if (stats.__isset.max_value) {
         page_statistics.set_max(stats.max_value);
       }
       if (stats.__isset.min_value) {
         page_statistics.set_min(stats.min_value);
       }
   ```



-- 
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