Skip to content

[core] Fix false-positive immutability check for normalized options.#8170

Open
Stephen0421 wants to merge 1 commit into
apache:masterfrom
Stephen0421:fix/normalized-immutable-options-check
Open

[core] Fix false-positive immutability check for normalized options.#8170
Stephen0421 wants to merge 1 commit into
apache:masterfrom
Stephen0421:fix/normalized-immutable-options-check

Conversation

@Stephen0421

Copy link
Copy Markdown
Contributor

Purpose

Schema.normalizePrimaryKeys() / normalizePartitionKeys() strip these keys from the options map during table creation and store them in dedicated schema fields instead. When the table is later read via Spark 4.x (where the DataSource V2 framework merges Table.properties() into scan options), the same primary-key / partition value reappears in dynamicOptions, but the stored options map no longer contains it. checkImmutability() compares null (old) against the actual value (new), treats it as a change, and throws:

"Change 'primary-key' is not supported yet."

Fix: skip the immutability check when oldValue is null for primary-key/partition and the new value matches the schema's actual primary/partition keys — the value hasn't changed, it was just normalized out of the options map.

Tests

paimon-core/src/test/java/org/apache/paimon/schema/SchemaManagerTest.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant