Copilot commented on code in PR #50183:
URL: https://github.com/apache/arrow/pull/50183#discussion_r3415941413
##########
cpp/src/parquet/statistics.cc:
##########
@@ -330,6 +351,17 @@ struct CompareHelper<Float16LogicalType,
/*is_signed=*/true> {
using ::std::optional;
+// A usable min/max pair always satisfies min <= max. The reverse ordering
+// (min > max) is produced only by the inverted DefaultMin()/DefaultMax() seeds
+// -- left in place when no valid, non-NaN value was observed -- or by an
+// inverted caller-supplied range; in either case there is no statistic to
emit.
+// Testing the ordering keeps this independent of the specific seed values, so
it
+// cannot drift from DefaultMin()/DefaultMax().
+template <typename T>
+bool IsInvalidMinMax(const T& min, const T& max) {
+ return max < min;
+}
Review Comment:
`IsInvalidMinMax` is a very generic name and is introduced with external
linkage in a `.cc` file. To avoid potential link-time multiple-definition
conflicts with similarly named helpers in other translation units, give it
internal linkage (e.g., place it in an anonymous namespace or mark it `static`).
--
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]