mapleFU commented on code in PR #35989:
URL: https://github.com/apache/arrow/pull/35989#discussion_r1229897390
##########
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.
Review Comment:
https://github.com/apache/arrow/commit/43c7154894f819e617dbf3d669dbe1185f05893b#diff-f8a090a40e214aba5ebff534411a9febf213b725597afb750395d2a7483d9bc1
I guess these code is written in 2016 and never changed the syntax for add
distinct count. Maybe it's designed like dictionary in Arrow IPC Streaming?
--
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]