kou commented on code in PR #46385:
URL: https://github.com/apache/arrow/pull/46385#discussion_r2192325088


##########
cpp/src/arrow/array/statistics_test.cc:
##########
@@ -152,4 +171,11 @@ TEST_F(TestArrayStatisticsEqualityDoubleValue, 
ApproximateEquals) {
   ASSERT_TRUE(statistics1_.Equals(statistics2_, 
options_.atol(1e-3).use_atol(true)));
 }
 
+TEST_F(TestArrayStatisticsEqualityDoubleValue, AverageByteWidth) {
+  statistics1_.average_byte_width = 4.2;
+  ASSERT_FALSE(statistics1_.Equals(statistics2_));
+  statistics2_.average_byte_width = 4.2;
+  ASSERT_TRUE(statistics1_.Equals(statistics2_));
+}
+

Review Comment:
   ```suggestion
   ```



##########
cpp/src/arrow/array/statistics_test.cc:
##########
@@ -81,6 +92,14 @@ TEST(TestArrayStatistics, EqualityNonDoulbeValue) {
   statistics2.distinct_count = 2929;
   ASSERT_EQ(statistics1, statistics2);
 
+  // Although this assertion is meaningless without average_byte_width,
+  // the purpose here is simply to check whether is_average_byte_width_exact
+  // is included in the Equality.
+  statistics1.is_average_byte_width_exact = true;
+  ASSERT_NE(statistics1, statistics2);
+  statistics2.is_average_byte_width_exact = true;
+  ASSERT_EQ(statistics1, statistics2);
+

Review Comment:
   Could you add `average_byte_width` case here like we did for 
`min`/`is_min_exact`?
   
   ```cpp
   statistics1.average_byte_width = ...
   ...
   
   statistics1.is_average_byte_width_exact = ...
   ...
   ```



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