amogh-jahagirdar commented on code in PR #8533:
URL: https://github.com/apache/iceberg/pull/8533#discussion_r1322253780


##########
aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java:
##########
@@ -524,7 +529,11 @@ public Map<String, String> loadNamespaceMetadata(Namespace 
namespace)
 
   @Override
   public boolean dropNamespace(Namespace namespace) throws 
NamespaceNotEmptyException {
-    namespaceExists(namespace);
+    // check if namespace exists
+    if (!namespaceExists(namespace)) {

Review Comment:
   Yeah I think this is a reasonable behavior change according to how the 
interface describes the expectation:
   
   ```
      * Drop a namespace. If the namespace exists and was dropped, this will 
return true.
   ```
   
   @jackye1995 let us know if you see any issues with this



##########
aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java:
##########
@@ -286,8 +286,12 @@ protected String defaultWarehouseLocation(TableIdentifier 
tableIdentifier) {
   }
 
   @Override
-  public List<TableIdentifier> listTables(Namespace namespace) {
-    namespaceExists(namespace);
+  public List<TableIdentifier> listTables(Namespace namespace) throws 
NoSuchNamespaceException {
+    // check if namespace exists
+    if (!namespaceExists(namespace)) {
+      throw new NoSuchNamespaceException(
+          "Cannot list tables of namespace %s because it does not exist", 
namespace);
+    }

Review Comment:
   This is a behavior change but going through the Java doc, this is the 
expectation for catalog impls and it does make sense. I guess somehow this just 
got missed originally.
   
   ```
     /**
      * Return all the identifiers under this namespace.
      *
      * @param namespace a namespace
      * @return a list of identifiers for tables
      * @throws NoSuchNamespaceException if the namespace is not found
      */
   ```



##########
aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java:
##########
@@ -524,7 +528,11 @@ public Map<String, String> loadNamespaceMetadata(Namespace 
namespace)
 
   @Override
   public boolean dropNamespace(Namespace namespace) throws 
NamespaceNotEmptyException {
-    namespaceExists(namespace);
+    // check if namespace exists
+    if (!namespaceExists(namespace)) {
+      LOG.error("Cannot drop namespace {} because it does not exist.", 
namespace);

Review Comment:
   I don't think there needs to be an error log (or any log for this case) at 
the catalog level. I think different integrations can use the boolean response 
and make their own judgement on how to handle the drop not occurring due to the 
namespace not existing (which may be logging, throwing something themselves, 
etc).



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to