jerqi commented on code in PR #4055:
URL: https://github.com/apache/gravitino/pull/4055#discussion_r1771160198


##########
core/src/main/java/org/apache/gravitino/storage/relational/service/UserMetaService.java:
##########
@@ -265,4 +281,60 @@ public int deleteUserMetasByLegacyTimeline(long 
legacyTimeline, int limit) {
 
     return userDeletedCount[0] + userRoleRelDeletedCount[0];
   }
+
+  private static class ListSkippingRolesHandler
+      implements SupportsSkippingFields<List<UserEntity>> {
+    private final String metalakeName;
+
+    ListSkippingRolesHandler(String metalakeName) {
+      this.metalakeName = metalakeName;
+    }
+
+    @Override
+    public List<Field> supportsSkippingFields() {
+      return Lists.newArrayList(UserEntity.ROLE_IDS, UserEntity.ROLE_NAMES);
+    }
+
+    @Override
+    public List<UserEntity> execute() {
+      List<UserPO> userPOs =
+          SessionUtils.getWithoutCommit(
+              UserMetaMapper.class, mapper -> 
mapper.listUserPOsByMetalake(metalakeName));
+      return userPOs.stream()
+          .map(
+              po ->
+                  POConverters.fromUserPO(
+                      po,
+                      Collections.emptyList(),
+                      AuthorizationUtils.ofUserNamespace(metalakeName)))
+          .collect(Collectors.toList());
+    }
+  }

Review Comment:
   It's hard to use skippingFields to generate the SQL. So this just uses 
mapping.



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