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

JingsongLi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new 350a13edbf [core] Validate deletion vector mode when resetting table 
options (#9237)
350a13edbf is described below

commit 350a13edbf008eef753282f5e13982973ea55833
Author: Arnav Balyan <[email protected]>
AuthorDate: Sat Aug 15 17:46:42 2026 +0530

    [core] Validate deletion vector mode when resetting table options (#9237)
---
 .../java/org/apache/paimon/schema/SchemaManager.java     |  8 ++++++++
 .../paimon/flink/DataEvolutionDeleteSqlITCase.java       | 16 ++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git 
a/paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java 
b/paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java
index 4c238781b9..bcb4a59b4f 100644
--- a/paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java
+++ b/paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java
@@ -1446,6 +1446,14 @@ public class SchemaManager implements Serializable {
             throw new UnsupportedOperationException(String.format("Cannot 
reset %s.", key));
         }
 
+        if (DELETION_VECTORS_ENABLED.key().equals(key)) {
+            checkAlterTableOption(
+                    options,
+                    key,
+                    options.get(key),
+                    DELETION_VECTORS_ENABLED.defaultValue().toString());
+        }
+
         if (options.containsKey(PK_CLUSTERING_OVERRIDE.key())
                 && CLUSTERING_COLUMNS.key().equals(key)) {
             throw new UnsupportedOperationException(
diff --git 
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/DataEvolutionDeleteSqlITCase.java
 
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/DataEvolutionDeleteSqlITCase.java
index d2360d2f8e..2115105394 100644
--- 
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/DataEvolutionDeleteSqlITCase.java
+++ 
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/DataEvolutionDeleteSqlITCase.java
@@ -133,6 +133,22 @@ public class DataEvolutionDeleteSqlITCase extends 
CatalogITCaseBase {
                         "Data-evolution delete requires 
deletion-vectors.enabled to be true.");
     }
 
+    @Test
+    public void testResetDeletionVectorsAfterDelete() throws Exception {
+        createTable();
+        sql("INSERT INTO T VALUES (1, 'one', 'A'), (2, 'two', 'A'), (3, 
'three', 'A')");
+        sql("DELETE FROM T WHERE id = 2");
+
+        assertThat(deletionVectorCardinality(paimonTable("T"))).isEqualTo(1L);
+        assertThatThrownBy(() -> sql("ALTER TABLE T RESET 
('deletion-vectors.enabled')"))
+                .hasRootCauseMessage(
+                        "Cannot change deletion vectors mode from true to 
false. If modifying table "
+                                + "deletion-vectors mode without 
full-compaction, this may result in data "
+                                + "duplication. If you are confident, you can 
set table option "
+                                + "'deletion-vectors.modifiable' = 'true' to 
allow deletion vectors modification.");
+        assertThat(sql("SELECT id FROM T ORDER BY 
id")).containsExactly(Row.of(1), Row.of(3));
+    }
+
     @Test
     public void testDeleteWithSubquery() {
         createTable();

Reply via email to