Abyss-lord commented on code in PR #6211:
URL: https://github.com/apache/gravitino/pull/6211#discussion_r1915079354


##########
core/src/main/java/org/apache/gravitino/authorization/AuthorizationUtils.java:
##########
@@ -465,30 +471,72 @@ public static List<String> getMetadataObjectLocation(
           }
           break;
         case SCHEMA:
-          {
-            Catalog catalogObj =
-                GravitinoEnv.getInstance()
-                    .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")) {
-              Schema schema = 
GravitinoEnv.getInstance().schemaDispatcher().loadSchema(ident);
-              if (schema.properties().containsKey(HiveConstants.LOCATION)) {
+          Catalog catalogObj =
+              GravitinoEnv.getInstance()
+                  .catalogDispatcher()
+                  .loadCatalog(
+                      NameIdentifier.of(ident.namespace().level(0), 
ident.namespace().level(1)));
+          Schema schema = 
GravitinoEnv.getInstance().schemaDispatcher().loadSchema(ident);
+
+          switch (catalogObj.type()) {
+            case RELATIONAL:
+              LOG.info("Catalog provider is {}", catalogObj.provider());
+              if ("hive".equals(catalogObj.provider())
+                  && schema.properties().containsKey(HiveConstants.LOCATION)) {
                 String schemaLocation = 
schema.properties().get(HiveConstants.LOCATION);
-                if (schemaLocation != null && schemaLocation.isEmpty()) {
+                if (StringUtils.isNotBlank(schemaLocation)) {
                   locations.add(schemaLocation);
                 } else {
-                  LOG.warn("Schema %s location is not found", ident);
+                  LOG.warn("Schema {} location is not found", ident);
                 }
               }
-            }
-            // TODO: [#6133] Supports get Fileset schema location in the 
AuthorizationUtils
+              break;
+
+            case FILESET:
+              if (catalogObj instanceof HasPropertyMetadata) {

Review Comment:
   > The 2 seems weird for me. Is this consistent with Hive schema implement.
   
   If it's not a Hadoop fileset, can we only get the path from the fileset.



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