FANNG1 commented on code in PR #8592:
URL: https://github.com/apache/gravitino/pull/8592#discussion_r2362334711


##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/CatalogWrapperForREST.java:
##########
@@ -99,6 +102,30 @@ public LoadTableResponse loadTable(TableIdentifier 
identifier, boolean requestCr
     return loadTableResponse;
   }
 
+  /**
+   * Get table credentials.
+   *
+   * @param identifier The table identifier for which to load credentials
+   * @return A {@link 
org.apache.iceberg.rest.responses.LoadCredentialsResponse} object containing
+   *     the credentials.
+   */
+  public LoadCredentialsResponse loadTableCredentials(TableIdentifier 
identifier) {

Review Comment:
   loadTableCredentials -> getTableCredentials to keep consistent with others?



##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/CatalogWrapperForREST.java:
##########
@@ -99,6 +102,30 @@ public LoadTableResponse loadTable(TableIdentifier 
identifier, boolean requestCr
     return loadTableResponse;
   }
 
+  /**
+   * Get table credentials.
+   *
+   * @param identifier The table identifier for which to load credentials
+   * @return A {@link 
org.apache.iceberg.rest.responses.LoadCredentialsResponse} object containing
+   *     the credentials.
+   */
+  public LoadCredentialsResponse loadTableCredentials(TableIdentifier 
identifier) {
+    try {
+      LoadTableResponse loadTableResponse = super.loadTable(identifier);
+      Credential credential = getCredential(loadTableResponse);
+      // Convert Gravitino credential to Iceberg credential.
+      ImmutableCredential icebergCredential =
+          ImmutableCredential.builder()
+              .prefix(credential.credentialType())

Review Comment:
   it's not proper to passing credential type to prefix, the prefix is supposed 
to be the location like `s3://xx`, we could leave it empty for the prefix.



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