zhongyujiang opened a new pull request, #7545:
URL: https://github.com/apache/paimon/pull/7545

   ## Purpose
   
   This PR fixes an issue where Paimon creates a new schema version even when 
there are no actual changes to the schema content.
   
   Previously, when executing schema update operations like `setOption("foo", 
"bar")` where the option already had the same value, Paimon would still create 
a new schema version with an incremented ID. This resulted in unnecessary 
schema versions being created.
   
   Changes:
   1. Added `sameContent()` method to `TableSchema` to compare schema content 
while ignoring version and timeMillis
   2. Modified `SchemaManager.commitChanges()` to check if the new schema has 
the same content as the old one
   3. If no changes are detected, log an info message and return the existing 
schema without creating a new version
   4. Fixed `equals()` and `hashCode()` in `TableSchema` to include 
`highestFieldId` for proper comparison
   
   ## Tests
   
   Added `testNoChangeCommitDoesNotCreateNewSchema()` in `SchemaManagerTest`:
   - Creates a table with an option `foo=bar`
   - Calls `commitChanges(SchemaChange.setOption("foo", "bar"))` with the same 
value
   - Verifies that no new schema version is created (ID remains the same)
   - Also tests `updateComment` with unchanged comment value


-- 
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