A0R0P0I7T opened a new pull request, #10201:
URL: https://github.com/apache/gravitino/pull/10201
<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
Examples:
- "[#123] feat(operator): support xxx"
- "[#233] fix: check null before access result in xxx"
- "[MINOR] refactor: fix typo in variable name"
- "[MINOR] docs: fix typo in README"
- "[#255] test: fix flaky test NameOfTheTest"
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?
Adds validation in `TableUpdatesRequest.validate()` to ensure that the
updates list is not empty before applying table updates.
If the list is empty, an IllegalArgumentException is thrown.\
Additionally, a unit test (`testValidateEmptyUpdates`) is added to verify
that the validation correctly throws an exception when an empty updates list is
provided.
### Why are the changes needed?
Currently,
`TableUpdatesRequest.validate()` only checks that updates is not null.
However, an empty list of updates is also invalid because a table update
request without any updates should not be allowed.
This change ensures stronger validation and prevents invalid request from
being processed.
Fix: #8656
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
(Please test your changes, and provide instructions on how to test it:
Added a new unit test
1. `testValidateEmptyUpdates` in `TestTableUpdatesRequest`.
2. The test verifies that IllegalArgumentException is thrown when updates is
empty.
3. Existing tests were run to ensure no regressions.
--
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]