You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by ga...@apache.org on 2026/08/21 07:55:49 UTC

(iceberg-cpp) branch main updated: refactor: protect merging snapshot update hooks (#885)

This is an automated email from the ASF dual-hosted git repository.

wgtmac pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new a43d4ad7 refactor: protect merging snapshot update hooks (#885)
a43d4ad7 is described below

commit a43d4ad7766e0aac0ad436c95ac994ff533f167e
Author: Manu Zhang <Ow...@gmail.com>
AuthorDate: Fri Aug 21 15:55:43 2026 +0800

    refactor: protect merging snapshot update hooks (#885)
    
    Co-authored-by: Codex <co...@openai.com>
---
 src/iceberg/test/merging_snapshot_update_test.cc | 6 ++++++
 src/iceberg/update/merging_snapshot_update.h     | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/iceberg/test/merging_snapshot_update_test.cc b/src/iceberg/test/merging_snapshot_update_test.cc
index 00c4f642..70c6a1c1 100644
--- a/src/iceberg/test/merging_snapshot_update_test.cc
+++ b/src/iceberg/test/merging_snapshot_update_test.cc
@@ -139,6 +139,10 @@ class TestMergeAppend : public MergingSnapshotUpdate {
   std::string operation() override { return "append"; }
 
   // Expose protected API for test access
+  using MergingSnapshotUpdate::Apply;
+  using MergingSnapshotUpdate::CleanUncommitted;
+  using MergingSnapshotUpdate::Summary;
+
   Status AddFile(std::shared_ptr<DataFile> file) { return AddDataFile(std::move(file)); }
   Status AddDelete(std::shared_ptr<DataFile> file) {
     return AddDeleteFile(std::move(file));
@@ -285,6 +289,8 @@ class TestOverwriteUpdate : public MergingSnapshotUpdate {
   std::string operation() override { return DataOperation::kOverwrite; }
   int64_t GeneratedSnapshotId() { return SnapshotId(); }
 
+  using MergingSnapshotUpdate::Apply;
+
   Status AddDelete(std::shared_ptr<DataFile> file) {
     return AddDeleteFile(std::move(file));
   }
diff --git a/src/iceberg/update/merging_snapshot_update.h b/src/iceberg/update/merging_snapshot_update.h
index 6b9d90c4..65c3f6d3 100644
--- a/src/iceberg/update/merging_snapshot_update.h
+++ b/src/iceberg/update/merging_snapshot_update.h
@@ -64,6 +64,7 @@ class ICEBERG_EXPORT MergingSnapshotUpdate : public SnapshotUpdate {
  public:
   ~MergingSnapshotUpdate() override = default;
 
+ protected:
   // SnapshotUpdate overrides
   Result<std::vector<ManifestFile>> Apply(
       const TableMetadata& metadata_to_update,
@@ -73,7 +74,6 @@ class ICEBERG_EXPORT MergingSnapshotUpdate : public SnapshotUpdate {
 
   std::unordered_map<std::string, std::string> Summary() override;
 
- protected:
   /// \brief Constructor; reads merge configuration from table properties.
   explicit MergingSnapshotUpdate(std::string table_name,
                                  std::shared_ptr<TransactionContext> ctx);