dimas-b commented on code in PR #2508:
URL: https://github.com/apache/polaris/pull/2508#discussion_r2389695169


##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TransactionalMetaStoreManagerImpl.java:
##########
@@ -2307,6 +2310,73 @@ private PolarisEntityResolver 
resolveSecurableToRoleGrant(
     return result;
   }
 
+  private static ResolvedEntitiesResult getResolvedEntitiesResult(
+      PolarisCallContext callCtx,
+      TransactionalPersistence ms,
+      List<PolarisEntityId> entityIds,
+      Function<Integer, PolarisEntityType> entityTypeForIndex) {
+    List<PolarisBaseEntity> entities = ms.lookupEntitiesInCurrentTxn(callCtx, 
entityIds);
+    // mimic the behavior of loadEntity above, return null if not found or 
type mismatch
+    List<ResolvedPolarisEntity> ret =
+        IntStream.range(0, entityIds.size())
+            .mapToObj(
+                i -> {
+                  if (entities.get(i) != null
+                      && 
!entities.get(i).getType().equals(entityTypeForIndex.apply(i))) {
+                    return null;
+                  } else {
+                    return entities.get(i);
+                  }
+                })
+            .map(
+                e -> {
+                  if (e == null) {
+                    return null;
+                  } else {
+                    // load the grant records

Review Comment:
   nit: maybe add `toResolvedPolarisEntity()` as in 
`AtomicOperationMetaStoreManager`?



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