JingsongLi commented on code in PR #8170:
URL: https://github.com/apache/paimon/pull/8170#discussion_r3446271271
##########
paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java:
##########
@@ -337,7 +337,9 @@ private void checkImmutability(Map<String, String>
dynamicOptions) {
dynamicOptions.forEach(
(k, newValue) -> {
String oldValue = oldOptions.get(k);
- if (!Objects.equals(oldValue, newValue)) {
+ if (!Objects.equals(oldValue, newValue)
+ && !SchemaManager.isUnchangedNormalizedKey(
Review Comment:
Skipping the immutability check here is not enough because copyInternal
still merges this dynamic option into the copied TableSchema options. For a
primary-key table, table.copy(Collections.singletonMap("primary-key", "f0,f1"))
will now succeed, but the returned table has both schema.primaryKeys() and
schema.options().get("primary-key"). Converting that schema back through
TableSchema.toSchema() then throws "Cannot define primary key on DDL and table
options at the same time." Please also avoid carrying unchanged normalized keys
into the copied schema options, similar to what generateTableSchema does above,
so the copied table schema remains normalized.
--
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]