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

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


The following commit(s) were added to refs/heads/main by this push:
     new 9329819  fix(commit): allow disabled manifest delete stats option 
(#187)
9329819 is described below

commit 93298198c1c4895050f5630e15f363b0d0f8fe5d
Author: Joey <[email protected]>
AuthorDate: Thu Aug 6 10:59:50 2026 +0800

    fix(commit): allow disabled manifest delete stats option (#187)
    
    Parse manifest.delete-file-drop-stats and reject it only when enabled, 
because false matches the existing C++ commit behavior.
    
    
    AI-Model: gpt-5
    AI-Contributed/Feature: 8/8
    AI-Contributed/UT: 6/6
    
    Co-authored-by: Codex <[email protected]>
---
 src/paimon/core/operation/file_store_commit_impl.cpp      | 8 +++++++-
 src/paimon/core/operation/file_store_commit_impl_test.cpp | 6 ++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/paimon/core/operation/file_store_commit_impl.cpp 
b/src/paimon/core/operation/file_store_commit_impl.cpp
index 6342f9b..d70f84e 100644
--- a/src/paimon/core/operation/file_store_commit_impl.cpp
+++ b/src/paimon/core/operation/file_store_commit_impl.cpp
@@ -42,6 +42,7 @@
 #include "paimon/common/utils/binary_row_partition_computer.h"
 #include "paimon/common/utils/date_time_utils.h"
 #include "paimon/common/utils/fields_comparator.h"
+#include "paimon/common/utils/options_utils.h"
 #include "paimon/common/utils/path_util.h"
 #include "paimon/common/utils/scope_guard.h"
 #include "paimon/core/catalog/catalog_snapshot_commit.h"
@@ -116,7 +117,12 @@ Status FileStoreCommitImpl::ValidateCommitOptions(const 
CoreOptions& options) {
         unsupported_options.emplace_back(kCommitStrictModeLastSafeSnapshot);
     }
     if (raw_options.find(kManifestDeleteFileDropStats) != raw_options.end()) {
-        unsupported_options.emplace_back(kManifestDeleteFileDropStats);
+        PAIMON_ASSIGN_OR_RAISE(
+            bool manifest_delete_file_drop_stats,
+            OptionsUtils::GetValueFromMap<bool>(raw_options, 
kManifestDeleteFileDropStats));
+        if (manifest_delete_file_drop_stats) {
+            unsupported_options.emplace_back(kManifestDeleteFileDropStats);
+        }
     }
     if (raw_options.find(kSequenceSnapshotOrdering) != raw_options.end()) {
         unsupported_options.emplace_back(kSequenceSnapshotOrdering);
diff --git a/src/paimon/core/operation/file_store_commit_impl_test.cpp 
b/src/paimon/core/operation/file_store_commit_impl_test.cpp
index 405b828..309766d 100644
--- a/src/paimon/core/operation/file_store_commit_impl_test.cpp
+++ b/src/paimon/core/operation/file_store_commit_impl_test.cpp
@@ -2550,6 +2550,12 @@ TEST_F(FileStoreCommitImplTest, 
ValidateCommitOptionsRejectsUnsupportedOptions)
     ASSERT_OK(FileStoreCommitImpl::ValidateCommitOptions(ok_options));
 }
 
+TEST_F(FileStoreCommitImplTest, 
ValidateCommitOptionsAllowsDisabledManifestDeleteFileDropStats) {
+    ASSERT_OK_AND_ASSIGN(CoreOptions options,
+                         
CoreOptions::FromMap({{"manifest.delete-file-drop-stats", "false"}}));
+    ASSERT_OK(FileStoreCommitImpl::ValidateCommitOptions(options));
+}
+
 TEST_F(FileStoreCommitImplTest, DropPartitionWithEmptyPartitionsFails) {
     CommitContextBuilder context_builder(table_path_, "commit_user_1");
     ASSERT_OK_AND_ASSIGN(std::unique_ptr<CommitContext> commit_context,

Reply via email to