pitrou commented on code in PR #35989:
URL: https://github.com/apache/arrow/pull/35989#discussion_r1229929061
##########
cpp/src/parquet/statistics.cc:
##########
@@ -552,12 +560,19 @@ class TypedStatisticsImpl : public TypedStatistics<DType>
{
void Merge(const TypedStatistics<DType>& other) override {
this->num_values_ += other.num_values();
- if (other.HasNullCount()) {
+ // Merge always runs when Merge builder's page statistics
+ // into column chunk statistics, so it tent to have null count.
+ if (ARROW_PREDICT_TRUE(other.HasNullCount())) {
this->statistics_.null_count += other.null_count();
+ } else {
+ this->has_null_count_ = false;
}
- if (other.HasDistinctCount()) {
- this->statistics_.distinct_count += other.distinct_count();
+ // Distinct count cannot be merged.
+ if (has_distinct_count_) {
+ has_distinct_count_ = false;
}
+ // If !other.HasMinMax, might be all-nulls or nulls and nan,
Review Comment:
I think we can keep the code as-is indeed.
--
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]