From 6002e43d4cfb3e2a734981ed9af086fdcaf690c3 Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Fri, 30 Oct 2026 17:31:09 +0800 Subject: [PATCH] fix(realtime): avoid shared_ptr::unique for C++20 compatibility Replace the deprecated and C++20-removed shared_ptr::unique() API with equivalent use_count() checks so paimon-cpp remains usable by consumers building with newer C++ standards. --- src/paimon/core/realtime/arrow_deduplicate_realtime_store.cpp | 2 +- src/paimon/core/realtime/realtime_key_offset_index.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/paimon/core/realtime/arrow_deduplicate_realtime_store.cpp b/src/paimon/core/realtime/arrow_deduplicate_realtime_store.cpp index 9d44f8e6c..a19368157 100644 --- a/src/paimon/core/realtime/arrow_deduplicate_realtime_store.cpp +++ b/src/paimon/core/realtime/arrow_deduplicate_realtime_store.cpp @@ -283,7 +283,7 @@ ArrowDeduplicateRealtimeStore::AcquireKeyOffsetLookup() { } Status ArrowDeduplicateRealtimeStore::EnsureMutableDeletionBitmap() { - if (!pending_offset_deletions_.unique()) { + if (pending_offset_deletions_.use_count() != 1) { pending_offset_deletions_ = std::make_shared(*pending_offset_deletions_); } return Status::OK(); diff --git a/src/paimon/core/realtime/realtime_key_offset_index.cpp b/src/paimon/core/realtime/realtime_key_offset_index.cpp index c57a41fd0..1a4a347b4 100644 --- a/src/paimon/core/realtime/realtime_key_offset_index.cpp +++ b/src/paimon/core/realtime/realtime_key_offset_index.cpp @@ -64,7 +64,7 @@ Result> MutableKeyOffsetIndex::HashKeys( } Status MutableKeyOffsetIndex::EnsureMutable() { - if (offsets_.unique()) { + if (offsets_.use_count() == 1) { return Status::OK(); } PAIMON_ASSIGN_OR_RAISE(