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

Function GetMinMaxBinaryHelper

cpp/src/parquet/statistics.cc:604–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

602
603template <bool is_signed>
604std::pair<ByteArray, ByteArray> GetMinMaxBinaryHelper(
605 const TypedComparatorImpl<is_signed, ByteArrayType>& comparator,
606 const ::arrow::Array& values) {
607 using Helper = CompareHelper<ByteArrayType, is_signed>;
608
609 ByteArray min = Helper::DefaultMin();
610 ByteArray max = Helper::DefaultMax();
611 constexpr int type_length = -1;
612
613 const auto valid_func = [&](ByteArray val) {
614 min = Helper::Min(type_length, val, min);
615 max = Helper::Max(type_length, val, max);
616 };
617 const auto null_func = [&]() {};
618
619 if (::arrow::is_binary_like(values.type_id())) {
620 ::arrow::VisitArraySpanInline<::arrow::BinaryType>(
621 *values.data(), std::move(valid_func), std::move(null_func));
622 } else if (::arrow::is_large_binary_like(values.type_id())) {
623 ::arrow::VisitArraySpanInline<::arrow::LargeBinaryType>(
624 *values.data(), std::move(valid_func), std::move(null_func));
625 } else if (::arrow::is_binary_view_like(values.type_id())) {
626 ::arrow::VisitArraySpanInline<::arrow::BinaryViewType>(
627 *values.data(), std::move(valid_func), std::move(null_func));
628 } else {
629 throw ParquetException("Only binary-like data supported");
630 }
631
632 return {min, max};
633}
634
635template <>
636std::pair<ByteArray, ByteArray> TypedComparatorImpl<true, ByteArrayType>::GetMinMax(

Callers

nothing calls this directly

Calls 8

is_binary_likeFunction · 0.85
is_large_binary_likeFunction · 0.85
is_binary_view_likeFunction · 0.85
ParquetExceptionFunction · 0.85
MinFunction · 0.50
MaxFunction · 0.50
type_idMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected