From 97c229851c01ed8994f15a0eba7bfc575eccc0bd Mon Sep 17 00:00:00 2001 From: mwish Date: Tue, 14 Jan 2025 23:27:27 +0800 Subject: [PATCH] fix cleanup handling --- cpp/src/parquet/statistics.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cpp/src/parquet/statistics.cc b/cpp/src/parquet/statistics.cc index e54b94f1a861a..0371336eb4807 100644 --- a/cpp/src/parquet/statistics.cc +++ b/cpp/src/parquet/statistics.cc @@ -407,8 +407,18 @@ optional> CleanStatistic(std::pair min_max, optional> CleanStatistic( std::pair min_max, LogicalType::Type::type) { - if (min_max.first.ptr == nullptr || min_max.second.ptr == nullptr) { - return ::std::nullopt; + static ByteArray empty(""); + if (min_max.first.ptr == nullptr) { + if (min_max.first.len != 0) { + return ::std::nullopt; + } + min_max.first = empty; + } + if (min_max.second.ptr == nullptr) { + if (min_max.second.len != 0) { + return ::std::nullopt; + } + min_max.second = empty; } return min_max; }