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

Method Merge

cpp/src/parquet/statistics.cc:789–813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

787 }
788
789 void Merge(const TypedStatistics<DType>& other) override {
790 this->num_values_ += other.num_values();
791 // null_count is always valid when merging page statistics into
792 // column chunk statistics.
793 if (other.HasNullCount()) {
794 this->statistics_.null_count += other.null_count();
795 } else {
796 this->has_null_count_ = false;
797 }
798 if (has_distinct_count_ && other.HasDistinctCount() &&
799 (distinct_count() == 0 || other.distinct_count() == 0)) {
800 // We can merge distinct counts if either side is zero.
801 statistics_.distinct_count =
802 std::max(statistics_.distinct_count, other.distinct_count());
803 } else {
804 // Otherwise clear has_distinct_count_ as distinct count cannot be merged.
805 this->has_distinct_count_ = false;
806 }
807 // Do not clear min/max here if the other side does not provide
808 // min/max which may happen when other is an empty stats or all
809 // its values are null and/or NaN.
810 if (other.HasMinMax()) {
811 SetMinMax(other.min(), other.max());
812 }
813 }
814
815 void Update(const T* values, int64_t num_values, int64_t null_count) override;
816 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