deniskuzZ commented on code in PR #6458:
URL: https://github.com/apache/hive/pull/6458#discussion_r3169186387


##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogAdapter.java:
##########
@@ -377,6 +398,23 @@ private RESTResponse dropView(Map<String, String> vars) {
     return null;
   }
 
+  private LoadTableResponse attachCredentials(Set<AccessDelegationMode> 
accessDelegationModes, TableIdentifier ident,
+      LoadTableResponse response) {
+    if (credentialProvider == null) {
+      return response;
+    }
+
+    if 
(accessDelegationModes.contains(AccessDelegationMode.VENDED_CREDENTIALS)) {

Review Comment:
   could we do small refactor
   ````
   private LoadTableResponse attachCredentials(
       Set<AccessDelegationMode> modes,
       TableIdentifier ident,
       LoadTableResponse response) {
   
     if (credentialProvider == null) {
       return response;
     }
   
     if (modes.contains(AccessDelegationMode.VENDED_CREDENTIALS)) {
       return withVendedCredentials(ident, response);
     }
   
     if (modes.contains(AccessDelegationMode.REMOTE_SIGNING)) {
       LOG.warn("Remote signing is not supported. Ignoring...");
     }
   
     return response;
   }
   
   private LoadTableResponse withVendedCredentials(
       TableIdentifier ident,
       LoadTableResponse response) {
   
     var credentials = credentialProvider.vend(
         ident,
         response.tableMetadata().location());
   
     return LoadTableResponse.builder()
         .withTableMetadata(response.tableMetadata())
         .addAllConfig(response.config())
         .addAllCredentials(credentials)
         .build();
   }
   ````



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to