mchades commented on code in PR #5761:
URL: https://github.com/apache/gravitino/pull/5761#discussion_r1872639045


##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -677,11 +678,42 @@ 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);
     }
   }
 
+  private boolean haveAvailableSchemas(
+      List<SchemaEntity> schemaEntities, CatalogEntity catalogEntity, 
CatalogWrapper catalogWrapper)
+      throws Exception {
+    if (schemaEntities.isEmpty()) {
+      return false;
+    }
+
+    if (schemaEntities.size() == 1 && 
catalogEntity.getProvider().equals("kafka")) {

Review Comment:
   > so ... do we have that 'default' schema recorded as we do for other 
catalogs?
   > We can remove this if () condition if so.
   > In theory, the default schema is still a schema. Returning false is not a 
good idea. And this shortcut complicates  the code.
   
   this function is `hasAvailableSchemas` not `hasSchemas`, the "default" 
schema of Kafka catalog in this function is not treated as an available schema.
   
   > I was striving to reduce hard-coded specializations in the code.
   
   
   The `Catalog` API is user-oriented. If we were to add a method like 
`isProviderEvil()` to the API, it might confuse users and require additional 
explanation. It would be more costly than adding an extra method such as 
`inRawStatus(CatalogEntity, List<SchemaEntity>)` in this class.



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