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 abcce36443 [core] Reject resetting ignore-delete and
ignore-update-before from true (#9421)
abcce36443 is described below
commit abcce36443cbe938b29a3a0537910955812961a0
Author: ZIHAN DAI <[email protected]>
AuthorDate: Fri Aug 28 18:20:43 2026 +1000
[core] Reject resetting ignore-delete and ignore-update-before from true
(#9421)
---
.../org/apache/paimon/schema/SchemaManager.java | 10 +++++++++
.../apache/paimon/schema/SchemaManagerTest.java | 25 ++++++++++++++++++++++
2 files changed, 35 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 73e947d9fa..69658fc221 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
@@ -1486,6 +1486,16 @@ public class SchemaManager implements Serializable {
DELETION_VECTORS_ENABLED.defaultValue().toString());
}
+ if (IGNORE_DELETE.key().equals(key)) {
+ checkAlterTableOption(
+ options, key, options.get(key),
IGNORE_DELETE.defaultValue().toString());
+ }
+
+ if (IGNORE_UPDATE_BEFORE.key().equals(key)) {
+ checkAlterTableOption(
+ options, key, options.get(key),
IGNORE_UPDATE_BEFORE.defaultValue().toString());
+ }
+
if (options.containsKey(PK_CLUSTERING_OVERRIDE.key())
&& CLUSTERING_COLUMNS.key().equals(key)) {
throw new UnsupportedOperationException(
diff --git
a/paimon-core/src/test/java/org/apache/paimon/schema/SchemaManagerTest.java
b/paimon-core/src/test/java/org/apache/paimon/schema/SchemaManagerTest.java
index d8dbc7ccaa..a44bd78f00 100644
--- a/paimon-core/src/test/java/org/apache/paimon/schema/SchemaManagerTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/schema/SchemaManagerTest.java
@@ -27,6 +27,7 @@ import org.apache.paimon.fs.FileIOFinder;
import org.apache.paimon.fs.Path;
import org.apache.paimon.fs.local.LocalFileIO;
import org.apache.paimon.iceberg.IcebergOptions;
+import org.apache.paimon.options.ConfigOption;
import org.apache.paimon.reader.RecordReaderIterator;
import org.apache.paimon.table.FileStoreTable;
import org.apache.paimon.table.FileStoreTableFactory;
@@ -77,6 +78,8 @@ import java.util.stream.Stream;
import static org.apache.paimon.CoreOptions.DELETION_VECTORS_ENABLED;
import static org.apache.paimon.CoreOptions.DELETION_VECTORS_MODIFIABLE;
+import static org.apache.paimon.CoreOptions.IGNORE_DELETE;
+import static org.apache.paimon.CoreOptions.IGNORE_UPDATE_BEFORE;
import static org.apache.paimon.utils.FailingFileIO.retryArtificialException;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
@@ -1558,4 +1561,26 @@ public class SchemaManagerTest {
.newWrite("u"))
.doesNotThrowAnyException();
}
+
+ @Test
+ public void testResetCannotWeakenAnOptionThatSetCannotWeaken() {
+ // Resetting an option puts it back to its default. For these three
the default is the
+ // weaker value, so a reset is the same change that setting it
explicitly already rejects.
+ for (ConfigOption<Boolean> option :
+ Arrays.asList(DELETION_VECTORS_ENABLED, IGNORE_DELETE,
IGNORE_UPDATE_BEFORE)) {
+ Map<String, String> enabled = new HashMap<>();
+ enabled.put(option.key(), "true");
+ assertThatThrownBy(
+ () -> SchemaManager.checkResetTableOption(enabled,
option.key()),
+ option.key())
+ .isInstanceOf(UnsupportedOperationException.class);
+
+ // resetting an option that is already at its default changes
nothing
+ Map<String, String> disabled = new HashMap<>();
+ disabled.put(option.key(), "false");
+ assertThatCode(() -> SchemaManager.checkResetTableOption(disabled,
option.key()))
+ .as("%s", option.key())
+ .doesNotThrowAnyException();
+ }
+ }
}