github-actions[bot] opened a new pull request, #7764:
URL: https://github.com/apache/gravitino/pull/7764

   <!--
   1. Title: [#7703] fix(types): add precision check in Decimal equals()
      Reference: https://www.conventionalcommits.org/en/v1.0.0/
   2. If the PR is unfinished, please mark this PR as draft.
   -->
   
   ### What changes were proposed in this pull request?
   
   This PR modifies the `equals()` method in the `Decimal` class 
(`Decimal.java`) to include a comparison of the `precision` field in addition 
to `scale` and `value`.  
   This change ensures that two `Decimal` instances are only considered equal 
if their precision, scale, and value match.  
   
   Additionally, a unit test has been added to `TestTypes.java` to validate the 
correct behavior of the updated `equals()` method.
   
   ### Why are the changes needed?
   
   Previously, the `equals()` method only compared the `scale` and `value`, 
ignoring the `precision`.  
   This could result in incorrect equality results for two decimal types with 
the same value and scale, but different precision.  
   
   Fixes: #7703
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, this PR does not introduce any user-facing API or configuration change. 
It only improves internal logic correctness.
   
   ### How was this patch tested?
   
   - Added a unit test in `TestTypes.java`:
     - Confirmed that two decimal types with same scale and precision are equal.
     - Confirmed that two decimal types with different precision are not equal.
   - If the Gradle build fails due to JDK 21, code correctness was verified 
manually.
   
   


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