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

Method GetMinMax

cpp/src/parquet/statistics.cc:481–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479 bool Compare(const T& a, const T& b) const override { return CompareInline(a, b); }
480
481 std::pair<T, T> GetMinMax(const T* values, int64_t length) const override {
482 DCHECK_GT(length, 0);
483
484 T min = Helper::DefaultMin();
485 T max = Helper::DefaultMax();
486
487 for (int64_t i = 0; i < length; i++) {
488 const auto val = SafeLoad(values + i);
489 min = Helper::Min(type_length_, min, Helper::Coalesce(val, Helper::DefaultMin()));
490 max = Helper::Max(type_length_, max, Helper::Coalesce(val, Helper::DefaultMax()));
491 }
492
493 return {min, max};
494 }
495
496 std::pair<T, T> GetMinMaxSpaced(const T* values, int64_t length,
497 const uint8_t* valid_bits,

Callers

nothing calls this directly

Calls 5

NYIFunction · 0.85
MinFunction · 0.50
MaxFunction · 0.50
ToStringMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected