FANNG1 commented on code in PR #9839:
URL: https://github.com/apache/gravitino/pull/9839#discussion_r2752246042
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/CatalogWrapperForREST.java:
##########
@@ -238,6 +239,36 @@ private Credential getCredential(
return credential;
}
+ private boolean shouldGenerateCredential(
+ LoadTableResponse loadTableResponse, boolean requestCredential) {
+ if (!requestCredential) {
+ return false;
+ }
+ return !isLocalOrHdfsTable(loadTableResponse.tableMetadata());
+ }
+
+ private boolean isLocalOrHdfsTable(TableMetadata tableMetadata) {
+ return isLocalOrHdfsLocation(tableMetadata.location());
+ }
+
+ @VisibleForTesting
+ static boolean isLocalOrHdfsLocation(String location) {
+ if (StringUtils.isBlank(location)) {
+ return false;
+ }
Review Comment:
It's a defense code, and the table location should not be null, WDYT?
--
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]