KayMas2808 opened a new pull request, #8701:
URL: https://github.com/apache/gravitino/pull/8701

   ### What changes were proposed in this pull request?
   
   This PR adds a `Preconditions.checkArgument` to the `upTo(String, BoundType, 
SortOrder)` method in `PartitionRange.java` to ensure the `comparator` argument 
is not null.
   
   ### Why are the changes needed?
   
   The `upTo` method was missing a null check for its `comparator` argument. 
This was inconsistent with the other factory methods (`downTo`, `between`) in 
the same class. Without this check, passing a `null` comparator could lead to a 
`NullPointerException` later in the execution path, making it harder to debug. 
This change ensures the method fails early with a clear error message.
   
   Fix: #8655
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Calling `PartitionRange.upTo(...)` with a `null` comparator will now 
immediately throw an `IllegalArgumentException`, which is the intended and 
consistent behavior for the class.
   
   ### How was this patch tested?
   
   - Added a new unit test, `testUpToWithNullComparator`, to 
`TestPartitionRange.java` as suggested in the issue description.
   - The test verifies that calling `PartitionRange.upTo` with a null 
comparator correctly throws an `IllegalArgumentException`.
   - All other existing tests in the `:api` module were run and continue to 
pass.


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