nastra commented on code in PR #9877:
URL: https://github.com/apache/iceberg/pull/9877#discussion_r1514509086


##########
nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java:
##########
@@ -308,6 +308,10 @@ public List<Namespace> listNamespaces(Namespace namespace) 
throws NoSuchNamespac
   }
 
   public boolean dropNamespace(Namespace namespace) throws 
NamespaceNotEmptyException {
+    if (namespace.isEmpty()) {
+      // As creating empty namespaces is not supported
+      throw new NoSuchNamespaceException("Namespace does not exist: %s", 
namespace);

Review Comment:
   maybe just define a `checkNamespaceIsValid` method that is called in all 
places
   ```
   private void checkNamespaceIsValid(Namespace namespace) {
       if (namespace.isEmpty()) {
         throw new NoSuchNamespaceException("Invalid namespace: %s", namespace);
       }
     }
   ```
   The same is being done in `RESTSessionCatalog`. Also I agree, we don't wrap 
the namespace in single quotes in other places, so this one should also not wrap



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to