pitrou commented on code in PR #36866:
URL: https://github.com/apache/arrow/pull/36866#discussion_r1273581829


##########
cpp/src/parquet/metadata.cc:
##########
@@ -97,12 +97,15 @@ static std::shared_ptr<Statistics> MakeTypedColumnStats(
         metadata.statistics.__isset.null_count,
         metadata.statistics.__isset.distinct_count);
   }
+  // GH-34139: If SortOrder is not SIGNED, ignore min and max.
+  bool can_use_legacy_min_max = descr->sort_order() == SortOrder::SIGNED;
   // Default behavior
   return MakeStatistics<DType>(
       descr, metadata.statistics.min, metadata.statistics.max,
       metadata.num_values - metadata.statistics.null_count,
       metadata.statistics.null_count, metadata.statistics.distinct_count,
-      metadata.statistics.__isset.max || metadata.statistics.__isset.min,
+      can_use_legacy_min_max &&
+          (metadata.statistics.__isset.max || metadata.statistics.__isset.min),

Review Comment:
   Note that parquet-mr uses `&&` rather than `||`. It probably doesn't make a 
difference in practice (either min/max are both available, or none is 
available).



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