andishgar commented on code in PR #47183:
URL: https://github.com/apache/arrow/pull/47183#discussion_r2230395040


##########
cpp/src/arrow/compare.cc:
##########
@@ -1532,11 +1533,14 @@ bool DoubleEquals(const double& left, const double& 
right, const EqualOptions& o
   return result;
 }
 
-bool ArrayStatisticsValueTypeEquals(
-    const std::optional<ArrayStatistics::ValueType>& left,
-    const std::optional<ArrayStatistics::ValueType>& right, const 
EqualOptions& options) {
+template <typename Type>
+bool ArrayStatisticsValueTypeEquals(const std::optional<Type>& left,
+                                    const std::optional<Type>& right,
+                                    const EqualOptions& options) {
   if (!left.has_value() || !right.has_value()) {
     return left.has_value() == right.has_value();
+  } else if constexpr (std::is_floating_point_v<Type>) {
+    return DoubleEquals(left.value(), right.value(), options);

Review Comment:
   Yes, otherwise we get a compile-time error, since the type for 
average_byte_width is double



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to