Repository navigation
[python] Check option changes on tables with snapshots like Java - #10856
Merged
JingsongLi merged 1 commit intoOct 29, 2026
Merged
Conversation
On a table with snapshots, PyPaimon only rejected changes to the immutable options. Java SchemaManagerUtils.checkAlterTableOption and checkResetTableOption also reject, for example, changing bucket from or to -1 and resetting bucket, changing deletion-vectors.enabled without deletion-vectors.modifiable, and changing ignore-delete or ignore-update-before from true to false. Accepting them re-buckets or merges existing keys differently, which can produce duplicate rows in primary-key tables. These checks are now ported with Java's messages, and bucket-function.provider is added to the immutable options as in Java. As in Java, the checks compare with the table's options before the batch, and the rejections raise NotImplementedError, Python's counterpart of UnsupportedOperationException; changes still apply in order within a batch. Option values are compared as PyPaimon reads them, including native values, enums and boolean spellings such as yes.
plusplusjiajia
marked this pull request as ready for review
October 28, 2026 16:22
Contributor
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
On a table with snapshots, PyPaimon only rejected changes to the immutable options. Java
SchemaManagerUtils.checkAlterTableOptionandcheckResetTableOptionalso reject:bucketfrom or to-1, and resettingbucket;deletion-vectors.enabledunlessdeletion-vectors.modifiableis true;ignore-delete,ignore-update-beforeordata-evolution.nested-field.enabledfrom true to false;clustering.columnswhenpk-clustering-overrideis set.Accepting them re-buckets or merges existing keys differently, which can produce duplicate rows in primary-key tables.
These checks are now ported with Java's messages, and
bucket-function.provideris added to the immutable options as in Java. As in Java:NotImplementedError, Python's counterpart ofUnsupportedOperationException, instead ofValueError;bucketis parsed likeInteger.parseInt.Option values are compared as PyPaimon reads them, including native values, enums and boolean spellings such as
yes.Tests
TestAlterTableOptionsinschema_manager_test.py: immutable options, bucket changes and parsing, deletion vectors, options that cannot be disabled, clustering columns, the checks only applying with snapshots, native option values, comparison with the original options within a batch, and unchanged values written differently.FileSystemCatalogTest#test_alter_immutable_options: the catalog rejects these changes without creating a new schema.