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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to