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

Function GetMinMaxBinaryHelper

cpp/src/parquet/statistics.cc:549–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547
548template <bool is_signed>
549std::pair<ByteArray, ByteArray> GetMinMaxBinaryHelper(
550 const TypedComparatorImpl<is_signed, ByteArrayType>& comparator,
551 const ::arrow::Array& values) {
552 using Helper = CompareHelper<ByteArrayType, is_signed>;
553
554 ByteArray min = Helper::DefaultMin();
555 ByteArray max = Helper::DefaultMax();
556 constexpr int type_length = -1;
557
558 const auto valid_func = [&](ByteArray val) {
559 min = Helper::Min(type_length, val, min);
560 max = Helper::Max(type_length, val, max);
561 };
562 const auto null_func = [&]() {};
563
564 if (::arrow::is_binary_like(values.type_id())) {
565 ::arrow::VisitArraySpanInline<::arrow::BinaryType>(
566 *values.data(), std::move(valid_func), std::move(null_func));
567 } else if (::arrow::is_large_binary_like(values.type_id())) {
568 ::arrow::VisitArraySpanInline<::arrow::LargeBinaryType>(
569 *values.data(), std::move(valid_func), std::move(null_func));
570 } else if (::arrow::is_binary_view_like(values.type_id())) {
571 ::arrow::VisitArraySpanInline<::arrow::BinaryViewType>(
572 *values.data(), std::move(valid_func), std::move(null_func));
573 } else {
574 throw ParquetException("Only binary-like data supported");
575 }
576
577 return {min, max};
578}
579
580template <>
581std::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