wgtmac commented on code in PR #35989: URL: https://github.com/apache/arrow/pull/35989#discussion_r1241374931
########## cpp/src/parquet/statistics.cc: ########## @@ -463,6 +463,8 @@ class TypedStatisticsImpl : public TypedStatistics<DType> { public: using T = typename DType::c_type; + // Currently, this constructor will tend to be called by ColumnWriter to create the Review Comment: I still don't think comment with `currently` and `tend` is a good idea as it may easily be out of sync and confuses users. It would be good enough to simply describe its supposed use case. ########## cpp/src/parquet/statistics.cc: ########## @@ -543,7 +557,7 @@ class TypedStatisticsImpl : public TypedStatistics<DType> { ResetCounts(); has_min_max_ = false; has_distinct_count_ = false; - has_null_count_ = false; + has_null_count_ = true; Review Comment: What about adding something like `ResetHasFlags()` below? ```cpp void ResetHasFlags() { has_min_max_ = false; has_distinct_count_ = false; has_null_count_ = true; } ``` We can call it in the constructors and Reset() to make sure the initial states are consistent. ########## cpp/src/parquet/statistics.cc: ########## @@ -552,12 +568,17 @@ class TypedStatisticsImpl : public TypedStatistics<DType> { void Merge(const TypedStatistics<DType>& other) override { this->num_values_ += other.num_values(); + // Merge always runs when Merge builder's page statistics + // into column chunk statistics, so it tent to have null count. Review Comment: ```suggestion // into column chunk statistics, so it tends to have null count. ``` -- 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