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


##########
catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/SecureHadoopCatalogOperations.java:
##########
@@ -196,11 +149,12 @@ public boolean dropSchema(NameIdentifier ident, boolean 
cascade) throws NonEmpty
       Map<String, String> properties =
           
Optional.ofNullable(schemaEntity.properties()).orElse(Collections.emptyMap());
 
-      // Reset the current user based on the name identifier.
-      UserGroupInformation user = getUGIByIdent(properties, ident);
+      UserContext userContext =
+          UserContext.getUserContext(
+              ident, properties, null, 
hadoopCatalogOperations.getCatalogInfo());
+      boolean r = userContext.doAs(() -> 
hadoopCatalogOperations.dropSchema(ident, cascade), ident);
+      UserContext.clearUserContext(ident);

Review Comment:
   Why not use `userContext.close`?



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