thswlsqls opened a new issue, #8753:
URL: https://github.com/apache/paimon/issues/8753

   **Search before asking**
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   **Paimon version**
   master @ 345526e26 (2.0-SNAPSHOT)
   
   **Compute Engine**
   Engine-agnostic (core)
   
   **Minimal reproduce step**
   ```java
   SchemaChange a = SchemaChange.dropColumn(new String[] {"outer", "inner"});
   SchemaChange b = SchemaChange.dropColumn(new String[] {"outer", "inner"});
   a.equals(b);            // true
   a.hashCode() == b.hashCode();   // false
   ```
   Same for `SchemaChange.addColumn`, `renameColumn`, `updateColumnType` and 
`updateColumnDefaultValue`.
   
   **What doesn't meet your expectations?**
   These five nested classes in 
`paimon-api/src/main/java/org/apache/paimon/schema/SchemaChange.java` compare 
`String[] fieldNames` with `Arrays.equals` (content) but hash it with 
`Objects.hashCode` (array identity). Equal instances then produce different 
hash codes, breaking the `Object.hashCode` contract for a `@Public` API: 
hash-based containers (`HashSet`, `HashMap` key, `distinct()`) silently fail to 
match equal changes.
   
   **Anything else?**
   `UpdateColumnNullability` and `UpdateColumnComment` in the same file already 
use `Arrays.hashCode` — the fix is to align the other five. Same defect class 
as merged PR #8518 (`FunctionChange.UpdateDefinition.hashCode`).
   
   **Are you willing to submit a PR?**
   - [x] I'm willing to submit a PR!
   
   


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