PDGGK opened a new pull request, #9421:
URL: https://github.com/apache/paimon/pull/9421
### Purpose
`ALTER TABLE ... SET ('ignore-delete' = 'false')` is rejected on a table
where it is on:
```
Cannot change ignore-delete from true to false.
```
`ALTER TABLE ... RESET ('ignore-delete')` reaches the same state — the
option goes back to its default, which is `false` — and is accepted.
`checkResetTableOption` already mirrors the alter-side guards for immutable
options, `bucket`, `deletion-vectors.enabled` and `clustering.columns`.
`deletion-vectors.enabled` is handled by routing the reset through
`checkAlterTableOption` with the default as the new value:
```java
if (DELETION_VECTORS_ENABLED.key().equals(key)) {
checkAlterTableOption(
options, key, options.get(key),
DELETION_VECTORS_ENABLED.defaultValue().toString());
}
```
`ignore-delete` and `ignore-update-before` carry the same "cannot weaken"
rule in `checkAlterTableOption` but were not carried over. This mirrors them
the same way.
### Tests
`SchemaManagerTest#testResetCannotWeakenAnOptionThatSetCannotWeaken` walks
all three options that share the rule. For each: resetting from `true` must be
rejected, and resetting an option already at its default must not be.
Putting `deletion-vectors.enabled` in the same loop is deliberate — it
already passes on `master`, so it shows the loop is a fair test and it is only
the two new arms that were missing. Reverting the change, the failure names
which one:
```
java.lang.AssertionError:
[ignore-delete]
Expecting code to raise a throwable.
```
`mvn test -pl paimon-core -Dtest='org.apache.paimon.schema.**'` — 488 tests,
all passing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]