plusplusjiajia opened a new pull request, #8565:
URL: https://github.com/apache/paimon/pull/8565
### Purpose
Java's `SchemaManager` rejects altering structural options
(`IMMUTABLE_OPTIONS`: `primary-key`, `partition`, `merge-engine`, `bucket-key`,
`type`, ...) once a table has snapshots, but pypaimon applied
`SetOption`/`RemoveOption` with no guard at all — through the
filesystem/jdbc catalogs one could alter e.g. `merge-engine` or `type` on a
table with data, silently changing read semantics or making the table
unreadable (the REST path is safe: the server enforces it).
This ports the guard: `CoreOptions.IMMUTABLE_OPTIONS` mirrors the Java
`@Immutable` options; `commit_changes` rejects SET (when the value actually
changes) and RESET of those keys once a snapshot exists, with
the Java-identical error message. The empty-table carve-out is kept.
`test_time_travel_before_row_tracking_raises` relied on enabling
`row-tracking.enabled` on a table that already had a snapshot — a state the
Java guard forbids constructing — so it now asserts the alter itself
is rejected.
### Tests
New `test_alter_immutable_options` (empty-table allowed; with snapshots
SET/RESET rejected; mutable options unaffected). 229 tests across the
alter-related files pass.
--
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]