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

   ### What changes were proposed in this pull request?
   
   Handle partial failures gracefully in `JDBCBackend.batchGet()` for USER, 
GROUP, ROLE, and VIEW entity types by catching `NoSuchEntityException` per 
entity instead of letting it abort the entire batch.
   
   ### Why are the changes needed?
   
   `batchGet()` for USER/GROUP/ROLE/VIEW iterates entities individually (with a 
TODO for real batch SQL). If any entity does not exist, `NoSuchEntityException` 
is thrown immediately, aborting the batch. This is inconsistent with other 
entity types (TABLE, SCHEMA, METALAKE, etc.) that use `WHERE name IN (...)` SQL 
and simply return fewer rows for missing entities. Callers expecting partial 
results (e.g., resolving group-inherited roles) would fail on the first missing 
entity.
   
   ### Does this PR introduce any user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Added `testBatchGetGroupsPartialResults`, `testBatchGetUsersPartialResults`, 
and `testBatchGetRolesPartialResults` tests in `TestJDBCBackendBatchGet` that 
insert entities, then batch-get a mix of existing and nonexistent identifiers, 
verifying only existing entities are returned.


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