jerryshao commented on code in PR #5761:
URL: https://github.com/apache/gravitino/pull/5761#discussion_r1875787302
##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -677,11 +678,70 @@ public boolean dropCatalog(NameIdentifier ident, boolean
force)
} catch (NoSuchMetalakeException | NoSuchCatalogException ignored) {
return false;
- } catch (IOException e) {
+ } catch (GravitinoRuntimeException e) {
+ throw e;
+
+ } catch (Exception e) {
throw new RuntimeException(e);
}
}
+ /**
+ * Check if the given list of schema entities contains any currently
existing user-created
+ * schemas.
+ *
+ * <p>This method determines if there are valid user-created schemas by
comparing the provided
+ * schema entities with the actual schemas currently existing in the
external catalog. It
+ * excludes:
+ *
+ * <ul>
+ * <li>1. Automatically generated schemas (such as Kafka catalog's
"default" schema or
+ * JDBC-PostgreSQL catalog's "public" schema).
+ * <li>2. Schemas that have been dropped externally but still exist in the
entity store.
+ * </ul>
+ *
+ * @param schemaEntities The list of schema entities to check.
+ * @param catalogEntity The catalog entity to which the schemas belong.
+ * @param catalogWrapper The catalog wrapper for the catalog.
+ * @return True if the list of schema entities contains any valid
user-created schemas, false
+ * otherwise.
+ * @throws Exception If an error occurs while checking the schemas.
+ */
+ private boolean containsUserCreatedSchemas(
Review Comment:
How about change to `containsExternalSchemas`?
--
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]