Repository navigation
[core] Allow enabling 'partial-update.remove-record-on-delete' on existing tables - #11656
Merged
JingsongLi merged 1 commit intoDec 3, 2026
Conversation
…existing tables - CoreOptions.java, core_configuration.html: drop @immutable from partial-update.remove-record-on-delete and describe the one-way change - SchemaManagerUtils.java: allow false -> true only and reject true -> false and reset, like ignore-delete; conflicts with ignore-delete and sequence groups stay with the merge function validation - AbstractFileStoreTable.java: reject changing the option through dynamic options, compared by boolean value, so all jobs see the same value - SynchronizationActionBase.java: reload the table after ALTER instead of copying the old table, so CDC table conf can enable the option - schema_manager.py: mirror the one-way check, and mirror the delete option conflict checks of the Java merge function factory on every schema commit - file_store_table.py, core_options.py: mirror the dynamic option check and the mutability in pypaimon - SchemaManagerTest.java, DeleteFromTableTestBase.scala, MySqlSyncTableActionITCase.java, schema_manager_test.py, file_store_table_test.py, test_partial_update_e2e.py: cover allowed and rejected changes, dynamic options, conflicts, CDC table conf and a Spark DELETE after enabling
JingsongLi
reviewed
Dec 3, 2026
| k, oldValue, newValue, tableSchema)) { | ||
| // Every reader and writer must agree on it, otherwise -D records written | ||
| // by one job make the merge of the others fail. | ||
| if (PARTIAL_UPDATE_REMOVE_RECORD_ON_DELETE.key().equals(k)) { |
Contributor
There was a problem hiding this comment.
Why not put this check into SchemaManager.checkAlterTableOption?
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
partial-update.remove-record-on-deleteis@Immutable, so a partial-update table that already holds data cannot turn it on. Such a table can only runDELETE FROMby rewriting files, which fails unless the touched files are compacted. This PR allows a one-way change fromfalsetotruethroughALTER TABLE.The change is safe for existing data. Without the option, and without
ignore-deleteor sequence groups, a partial-update table rejects every retraction at merge time, so its data files hold no-Drecords. Enabling the option only affects records written afterwards.false(or unset) totrueis allowed.truetofalseandUNSETare rejected, because the table may then hold-Drecords that fail the merge once the option is off. This follows the existing check forignore-delete.ignore-deleteor sequence groups keeps going through the existing merge function validation, which runs on every schema change.spark.paimon.*, Flink hints, pypaimontable.copy) cannot change the value. Unlikeignore-delete = true, which drops-Dat write time, this option lets a job store-Drecords. If one job enables it temporarily, the other jobs, which still use the table's value, fail when they merge those records. Values are compared as booleans, so passing the current value is still allowed.SynchronizationActionBase#alterTableOptionsnow reloads the table after theALTER. Before, it copied the old table with the altered options, and that copy checked them as dynamic options against the old schema, so enabling this option through--table_confcommitted theALTERand then failed the job. Every option it passes has been persisted by theALTER, and the callers pass a table loaded bycatalog.getTable, so the reload loses nothing.ALTERcheck and the dynamic option check.PartialUpdateMergeFunction.Factory, which pypaimon did not do before.After enabling the option, restart the jobs that read or write the table. A job still running with the previous value fails when it merges a
-Drecord.Tests
SchemaManagerTest: one-way alter and reset checks.DeleteFromTableTestBase(Spark 3.5, V1 and V2 write): enabling the option on a table with uncompacted data and runningDELETE, dynamic options that change or keep the value, disabling andUNSET, and conflicts withignore-deleteand sequence groups.SchemaValidationTest, the full Spark 3.5DeleteFromTableTest/V2DeleteFromTableTestsuites, and the pypaimon schema, table, partial-update and aggregation tests pass.MySqlSyncTableActionITCase#testEnableRemoveRecordOnDeleteInExistingTablecovers the CDC fix. I could not run it locally because the MySQL test container was not reachable, so it needs CI. A core-level check confirmed the mechanism: copying the pre-ALTERtable is rejected, and reloading returns the new value.🤖 Generated with Claude Code