You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "LuciferYang (via GitHub)" <gi...@apache.org> on 2026/09/27 19:01:22 UTC
[PR] [core] Rewrite field-scoped options correctly on column rename [paimon]
LuciferYang opened a new pull request, #10278:
URL: https://github.com/apache/paimon/pull/10278
### Purpose
`SchemaManagerUtils.applyRenameColumnsToOptions` rewrites field-referencing options after a column rename. It mishandled three cases.
- Nested renames were keyed by their root column (`fieldNames()[0]`), so a nested rename relocated the root column's options to the nested new name (where the root column still exists under its old name), and two nested renames under one root threw a duplicate-key `IllegalStateException` from the toMap collector.
- CSV entries were split without trimming while the canonical readers all trim, so a spaced entry like `bucket-key = 'a, b'` kept the renamed-away name and the next schema commit aborted.
- `clustering.columns` was never rewritten, leaving writes resolving a dropped column. Its fallback key `sink.clustering.by-columns` was missing too, so a table configured through the old key kept a dangling column name.
This change filters the rename map to single-field renames, skips nested renames in the field-scoped rewrite, trims the split CSV entries to match the readers, and rewrites `clustering.columns` along with its fallback key alongside `bucket-key` and `sequence.field`.
This closes #10277.
### Tests
New `SchemaManagerUtilsTest`:
- `testNestedRenameLeavesRootOptionKeysAlone` and `testTwoNestedRenamesUnderOneRootDoNotCrash` pin that a nested rename does not relocate the root column's `fields.<col>.map.*` options and that two nested renames under one root no longer collide.
- `testSpacedCsvOptionEntriesMatchRename` and `testSequenceGroupValueEntriesMatchRenameTrimmed` pin that spaced entries in `bucket-key`, `sequence.field`, `clustering.columns`, and sequence-group values follow the rename.
- `testClusteringColumnsFollowRename` and `testClusteringColumnsFallbackKeyFollowsRename` pin that both `clustering.columns` and its fallback key follow the rename.
### API and Format
No.
### Documentation
No.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] Rewrite field-scoped options correctly on column rename [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #10278:
URL: https://github.com/apache/paimon/pull/10278#issuecomment-5936175593
[P2] Preserve exact sequence-group field names during unrelated renames (`SchemaManagerUtils.java`, lines 728–739).
Unlike bucket/sequence/clustering CSV readers, `PartialUpdateMergeFunction.sequenceGroupOrderingFields` and `sequenceGroupProtectedFields` split on comma without trimming; schema validation also resolves the ordering-field key by exact name. Leading/trailing spaces are allowed in quoted column names. Trimming these tokens therefore changes a valid field reference, even when that field is not being renamed.
I reproduced this through a real catalog table with primary key `id`, columns ` ts`, ` value`, and `x`, and options `merge-engine=partial-update`, `fields. ts.sequence-group= value`. A write/commit succeeds. Renaming only `x`→`y` on this PR rewrites the existing option to `fields.ts.sequence-group=value` and fails with `Field ts can not be found in table schema`. The same committed-table rename with the merge-base `SchemaManagerUtils` succeeds and preserves the original sequence-group names.
Trim only options whose actual parsing contract trims tokens. Keep sequence-group ordering/protected names exact, or introduce their parser-contract migration separately with compatibility coverage.
Validation: 91 normal Maven tests passed, plus actual catalog rename/write/read checks for spaced bucket/sequence CSV, canonical clustering and its fallback. The committed-table boundary-space case above and the merge-base helper control establish the new regression.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] Rewrite field-scoped options correctly on column rename [paimon]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang closed pull request #10278: [core] Rewrite field-scoped options correctly on column rename
URL: https://github.com/apache/paimon/pull/10278
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org