World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
Java ai-catalogdata-catalogdatalakefederated-querylakehousemetadatametalakemodel-catalogopendatacatalogskycomputingstratosphere
[#2913] Improvement(catalog-hadoop) Return false if the schema is not dropped. (#2984)
charliecheng630d0ad18a8ee32
diff --git a/catalogs/catalog-hadoop/src/main/java/com/datastrato/gravitino/catalog/hadoop/HadoopCatalogOperations.java b/catalogs/catalog-hadoop/src/main/java/com/datastrato/gravitino/catalog/hadoop/HadoopCatalogOperations.javaindex 2403cc5c17..cd87e2d2cc 100644--- a/catalogs/catalog-hadoop/src/main/java/com/datastrato/gravitino/catalog/hadoop/HadoopCatalogOperations.java+++ b/catalogs/catalog-hadoop/src/main/java/com/datastrato/gravitino/catalog/hadoop/HadoopCatalogOperations.java@@ -461,13 +461,13 @@ public class HadoopCatalogOperations implements CatalogOperations, SupportsSchemPath schemaPath = getSchemaPath(ident.name(), properties);// Nothing to delete if the schema path is not set.if (schemaPath == null) {- return true;+ return false;}FileSystem fs = schemaPath.getFileSystem(hadoopConf);// Nothing to delete if the schema path does not exist.if (!fs.exists(schemaPath)) {- return true;+ return false;}if (fs.listStatus(schemaPath).length > 0 && !cascade) {diff --git a/catalogs/catalog-hadoop/src/test/java/com/datastrato/gravitino/catalog/hadoop/TestHadoopCatalogOperations.java b/catalogs/catalog-hadoop/src/test/java/com/datastrato/gravitino/catalog/hadoop/TestHadoopCatalogOperations.javaindex 1eca47aba4..46a370c4c9 100644--- a/catalogs/catalog-hadoop/src/test/java/com/datastrato/gravitino/catalog/hadoop/TestHadoopCatalogOperations.java+++ b/catalogs/catalog-hadoop/src/test/java/com/datastrato/gravitino/catalog/hadoop/TestHadoopCatalogOperations.java@@ -327,6 +327,10 @@ public class TestHadoopCatalogOperations {// Test drop non-empty schema with cascade = trueops.dropSchema(id, true);Assertions.assertFalse(fs.exists(schemaPath));++ // Test drop empty schema+ Assertions.assertFalse(ops.dropSchema(id, true));+ Assertions.assertFalse(ops.dropSchema(id, false));}}