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

Method Merge

cpp/src/parquet/statistics.cc:734–758  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

732 }
733
734 void Merge(const TypedStatistics<DType>& other) override {
735 this->num_values_ += other.num_values();
736 // null_count is always valid when merging page statistics into
737 // column chunk statistics.
738 if (other.HasNullCount()) {
739 this->statistics_.null_count += other.null_count();
740 } else {
741 this->has_null_count_ = false;
742 }
743 if (has_distinct_count_ && other.HasDistinctCount() &&
744 (distinct_count() == 0 || other.distinct_count() == 0)) {
745 // We can merge distinct counts if either side is zero.
746 statistics_.distinct_count =
747 std::max(statistics_.distinct_count, other.distinct_count());
748 } else {
749 // Otherwise clear has_distinct_count_ as distinct count cannot be merged.
750 this->has_distinct_count_ = false;
751 }
752 // Do not clear min/max here if the other side does not provide
753 // min/max which may happen when other is an empty stats or all
754 // its values are null and/or NaN.
755 if (other.HasMinMax()) {
756 SetMinMax(other.min(), other.max());
757 }
758 }
759
760 void Update(const T* values, int64_t num_values, int64_t null_count) override;
761 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