MCPcopy Create free account
hub / github.com/apache/arrow / Merge

Method Merge

cpp/src/parquet/statistics.cc:702–726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700 }
701
702 void Merge(const TypedStatistics<DType>& other) override {
703 this->num_values_ += other.num_values();
704 // null_count is always valid when merging page statistics into
705 // column chunk statistics.
706 if (other.HasNullCount()) {
707 this->statistics_.null_count += other.null_count();
708 } else {
709 this->has_null_count_ = false;
710 }
711 if (has_distinct_count_ && other.HasDistinctCount() &&
712 (distinct_count() == 0 || other.distinct_count() == 0)) {
713 // We can merge distinct counts if either side is zero.
714 statistics_.distinct_count =
715 std::max(statistics_.distinct_count, other.distinct_count());
716 } else {
717 // Otherwise clear has_distinct_count_ as distinct count cannot be merged.
718 this->has_distinct_count_ = false;
719 }
720 // Do not clear min/max here if the other side does not provide
721 // min/max which may happen when other is an empty stats or all
722 // its values are null and/or NaN.
723 if (other.HasMinMax()) {
724 SetMinMax(other.min(), other.max());
725 }
726 }
727
728 void Update(const T* values, int64_t num_values, int64_t null_count) override;
729 void UpdateSpaced(const T* values, const uint8_t* valid_bits, int64_t valid_bits_offset,

Callers

nothing calls this directly

Calls 8

HasNullCountMethod · 0.80
HasDistinctCountMethod · 0.80
HasMinMaxMethod · 0.80
num_valuesMethod · 0.45
null_countMethod · 0.45
distinct_countMethod · 0.45
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected