HuaHuaY commented on code in PR #50807:
URL: https://github.com/apache/arrow/pull/50807#discussion_r4004002612


##########
cpp/src/parquet/statistics_test.cc:
##########
@@ -1467,21 +1471,47 @@ class TestFloatStatistics : public ::testing::Test {
     auto some_nan_stats = MakeStatistics<ParquetType>(descr);
     // Ingesting only nans should not yield valid min max
     AssertUnsetMinMax(some_nan_stats, all_nans);
+    ASSERT_EQ(std::make_optional(static_cast<int64_t>(all_nans.size())),
+              some_nan_stats->nan_count());
     // Ingesting a mix of NaNs and non-NaNs should yield a valid min max.
     AssertMinMaxAre(some_nan_stats, some_nans, min, max);
+    ASSERT_EQ(std::make_optional(static_cast<int64_t>(all_nans.size() + 3)),
+              some_nan_stats->nan_count());
     // Ingesting only nans after a valid min/max, should have no effect
     AssertMinMaxAre(some_nan_stats, all_nans, min, max);
+    ASSERT_EQ(std::make_optional(static_cast<int64_t>(all_nans.size() * 2 + 
3)),
+              some_nan_stats->nan_count());
 
     some_nan_stats = MakeStatistics<ParquetType>(descr);
     AssertUnsetMinMax(some_nan_stats, all_nans, &valid_bitmap);
+    ASSERT_EQ(std::make_optional<int64_t>(7), some_nan_stats->nan_count());

Review Comment:
   I will change it to `std::popcount(valid_bitmap)`.



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