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


##########
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:
   ```suggestion
             "Cannot list tables for namespace. Namespace does not exist: %s", 
namespace);
   ```



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

Review Comment:
   this comment is redundant and can be removed



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

Review Comment:
   I wonder whether we need to handle empty namespaces here as well?



##########
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 agree, no need to log anything. Just return `false`



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

Review Comment:
   comment can be removed



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