From bab311325d87b315c66adc1b8c3362992b635189 Mon Sep 17 00:00:00 2001 From: morningman Date: Sat, 18 Jul 2026 08:54:22 +0800 Subject: [PATCH] [fix](be) Fix macOS BE compilation errors ### What problem does this PR solve? Issue Number: None Related PR: None Problem Summary: Clang 20 fails the macOS BE build because the Linux-only PHDR cache state is unused on macOS and Parquet boolean column-index values are represented by std::vector proxy references. Restrict the PHDR state field to supported Linux builds and materialize Parquet page bounds as their physical C++ value types before decoding. ### Release note None ### Check List (For Author) - Test: Manual test - sh build.sh --be - Behavior changed: No - Does this need documentation: No --- be/src/common/phdr_cache.h | 2 ++ be/src/format_v2/parquet/parquet_statistics.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/be/src/common/phdr_cache.h b/be/src/common/phdr_cache.h index da18b698f0d18b..abf08a0500f8c0 100644 --- a/be/src/common/phdr_cache.h +++ b/be/src/common/phdr_cache.h @@ -75,5 +75,7 @@ class ScopedPHDRCacheRead { ScopedPHDRCacheRead& operator=(const ScopedPHDRCacheRead&) = delete; private: +#if defined(__linux__) && !defined(THREAD_SANITIZER) && !defined(USE_MUSL) bool _previous = false; +#endif }; diff --git a/be/src/format_v2/parquet/parquet_statistics.cpp b/be/src/format_v2/parquet/parquet_statistics.cpp index ff72c6982de301..ec404f40e15ffb 100644 --- a/be/src/format_v2/parquet/parquet_statistics.cpp +++ b/be/src/format_v2/parquet/parquet_statistics.cpp @@ -1046,8 +1046,8 @@ bool set_page_decoded_min_max(const std::shared_ptr<::parquet::ColumnIndex>& col page_idx >= typed_index->max_values().size()) { return false; } - const auto& min_value = typed_index->min_values()[page_idx]; - const auto& max_value = typed_index->max_values()[page_idx]; + const typename ParquetDType::c_type min_value = typed_index->min_values()[page_idx]; + const typename ParquetDType::c_type max_value = typed_index->max_values()[page_idx]; if constexpr (std::is_same_v) { if (!timestamp_min_max_is_safe(column_schema, min_value, max_value, timezone)) { return false;