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

   
   ### Purpose
   
   fix #8753
   
   - `AddColumn`, `RenameColumn`, `DropColumn`, `UpdateColumnType` and 
`UpdateColumnDefaultValue` compare `String[] fieldNames` with `Arrays.equals` 
but hash it with `Objects.hashCode`, which returns the array identity hash. 
Equal instances then produce different hash codes, violating the 
`Object.hashCode` contract of this `@Public` API, so hash-based containers 
cannot match them.
   - Fix: use `Arrays.hashCode(fieldNames)`, matching sibling 
`UpdateColumnNullability` and `UpdateColumnComment` in the same file.
   - Same defect class as merged PR #8518 
(`FunctionChange.UpdateDefinition.hashCode`).
   
   ```java
   result = 31 * result + Arrays.hashCode(fieldNames);
   ```
   
   ### Tests
   
   - Added `SchemaChangeTest`, one test per affected class: two instances built 
from distinct but equal `String[]` are `equals` and share a hash code. All 5 
fail before the fix.
   - `mvn -pl paimon-api -DfailIfNoTests=false clean install` (JDK 11) — 65 
unit + 22 integration-phase tests passed.
   
   
   


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