You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "tengqm (via GitHub)" <gi...@apache.org> on 2025/01/26 06:54:49 UTC

Re: [PR] [#6366] improvement(hadoop, authorization): support getting location of schema for gcs hadoop catalog. [gravitino]

tengqm commented on code in PR #6367:
URL: https://github.com/apache/gravitino/pull/6367#discussion_r1929675426


##########
core/src/main/java/org/apache/gravitino/authorization/AuthorizationUtils.java:
##########
@@ -445,7 +447,7 @@ public static List<String> getMetadataObjectLocation(
                         // The Hive default schema location is Hive warehouse directory
                         String defaultSchemaLocation =
                             getHiveDefaultLocation(ident.name(), catalogObj.name());
-                        if (defaultSchemaLocation != null && !defaultSchemaLocation.isEmpty()) {
+                        if (StringUtils.isNotBlank(defaultSchemaLocation)) {

Review Comment:
   💯 



##########
core/src/main/java/org/apache/gravitino/authorization/AuthorizationUtils.java:
##########
@@ -462,6 +464,13 @@ public static List<String> getMetadataObjectLocation(
               if (defaultSchemaLocation != null && !defaultSchemaLocation.isEmpty()) {

Review Comment:
   Change this as well?



##########
core/src/main/java/org/apache/gravitino/authorization/AuthorizationUtils.java:
##########
@@ -472,19 +481,20 @@ public static List<String> getMetadataObjectLocation(
                     .catalogDispatcher()
                     .loadCatalog(
                         NameIdentifier.of(ident.namespace().level(0), ident.namespace().level(1)));
-            LOG.info("Catalog provider is %s", catalogObj.provider());
-            if (catalogObj.provider().equals("hive")) {
+            LOG.info("Catalog provider is {}", catalogObj.provider());
+            String catalogProvider = catalogObj.provider();
+            if (Objects.equals(catalogProvider, "hive")
+                || Objects.equals(catalogProvider, "hadoop")) {

Review Comment:
   Why don't we just do string comparison?



-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org