yuqi1129 commented on code in PR #7424:
URL: https://github.com/apache/gravitino/pull/7424#discussion_r2157931321


##########
bundles/aws/build.gradle.kts:
##########
@@ -74,5 +74,5 @@ tasks.jar {
 }
 
 tasks.compileJava {
-  dependsOn(":catalogs:catalog-hadoop:runtimeJars")
+  dependsOn(":catalogs:catalog-fileset:runtimeJars")

Review Comment:
   Are we going to rename the package name 
`org.apache.gravitino.catalog.hadoop` in `hadoop-common`, `xxxx-bundle`?



##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -1198,4 +1210,32 @@ private CatalogEntity.Builder updateEntity(
 
     return builder.withProperties(newProps);
   }
+
+  private CatalogEntity convertFilesetCatalogEntity(CatalogEntity entity) {
+    if (entity.getType() != FILESET) {
+      return entity;
+    } else if (!entity.getProvider().equalsIgnoreCase("hadoop")) {
+      // If the provider is not "hadoop", we can return the entity as is.
+      return entity;
+    } else {
+      // If the provider is not "fileset", we need to convert it to a fileset 
catalog entity.
+      // This is a special case to maintain compatibility.
+      return CatalogEntity.builder()
+          .withId(entity.id())
+          .withName(entity.name())
+          .withNamespace(entity.namespace())
+          .withType(FILESET)
+          .withProvider("fileset")
+          .withComment(entity.getComment())
+          .withProperties(entity.getProperties())
+          .withAuditInfo(
+              AuditInfo.builder()
+                  .withCreator(entity.auditInfo().creator())
+                  .withCreateTime(entity.auditInfo().createTime())
+                  .withLastModifier(entity.auditInfo().lastModifier())
+                  .withLastModifiedTime(entity.auditInfo().lastModifiedTime())
+                  .build())
+          .build();
+    }
+  }

Review Comment:
   
   I suggest we can modified it to the following format to make it more clear: 
   ```java
    if (entity.getType() != FILESET) {
         return entity;
    }
   
   // Then the entity is a fileset and if the provider is `hadoop`, we need to 
change it to `fileset` to make it works in the current code base
   if (entity.getProvider().equalsIgnoreCase("hadoop")) {
       return xxxx
   }
   
   // This is a fileset and the provider is `fileset`, do nothing
   return entity.
   ```



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