diqiu50 commented on code in PR #8777:
URL: https://github.com/apache/gravitino/pull/8777#discussion_r2570348068


##########
catalogs/catalog-fileset/src/main/java/org/apache/gravitino/catalog/fileset/SecureFilesetCatalogOperations.java:
##########
@@ -157,21 +153,42 @@ public boolean dropFileset(NameIdentifier ident) {
       throw new RuntimeException("Failed to delete fileset " + ident, ioe);
     }
 
+    Map<String, String> filesetProperties =
+        mergeUpLevelConfigurations(ident, filesetEntity.properties());
     UserContext userContext =
         UserContext.getUserContext(
-            ident, filesetEntity.properties(), null, 
filesetCatalogOperations.getCatalogInfo());
+            ident, filesetProperties, 
filesetCatalogOperations.getCatalogInfo());
     boolean r = userContext.doAs(() -> 
filesetCatalogOperations.dropFileset(ident), ident);
     UserContext.clearUserContext(ident);
     return r;
   }
 
+  public Map<String, String> mergeUpLevelConfigurations(
+      NameIdentifier ident, Map<String, String> entityProperties) {
+    Map<String, String> mergedProperties = new 
HashMap<>(filesetCatalogOperations.getConf());
+    if (ident.namespace().levels().length == 2) {
+      // schema level
+      mergedProperties.putAll(entityProperties);
+      return mergedProperties;
+    }
+
+    // fileset level
+    NameIdentifierUtil.checkFileset(ident);
+    NameIdentifier schemaIdent = NameIdentifierUtil.getSchemaIdentifier(ident);
+    Schema schema = filesetCatalogOperations.loadSchema(schemaIdent);
+    mergedProperties.putAll(schema.properties());
+    mergedProperties.putAll(entityProperties);
+    return mergedProperties;
+  }

Review Comment:
   dropFileset is not called frequently



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