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

   **Search before asking**
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   **Paimon version**
   master @ 0e22fa885 / 2.0-SNAPSHOT
   
   **Compute Engine**
   Engine-agnostic (JavaAPI, paimon-api)
   
   **Minimal reproduce step**
   `FunctionChange.UpdateDefinition.hashCode()` 
(paimon-api/src/main/java/org/apache/paimon/function/FunctionChange.java line 
302) returns `Objects.hash(definition, definition)`: it hashes `definition` 
twice and omits `name`. Its own `equals()` compares both `name` and 
`definition`, and the sibling `AddDefinition.hashCode()` in the same file 
correctly uses `Objects.hash(name, definition)`.
   
   **What doesn't meet your expectations?**
   Two `UpdateDefinition` objects with the same `definition` but different 
`name` are unequal, yet collide into the same hash code. This degrades 
hash-based collections (HashMap/HashSet) that key on these objects.
   
   **Anything else?**
   N/A
   
   **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