rdblue commented on code in PR #9787:
URL: https://github.com/apache/iceberg/pull/9787#discussion_r1501174113


##########
core/src/main/java/org/apache/iceberg/inmemory/InMemoryCatalog.java:
##########
@@ -138,13 +138,13 @@ public boolean dropTable(TableIdentifier tableIdentifier, 
boolean purge) {
 
   @Override
   public List<TableIdentifier> listTables(Namespace namespace) {
-    if (!namespaceExists(namespace) && !namespace.isEmpty()) {
+    if (!namespaceExists(namespace)) {
       throw new NoSuchNamespaceException(
           "Cannot list tables for namespace. Namespace does not exist: %s", 
namespace);
     }
 
     return tables.keySet().stream()
-        .filter(t -> namespace.isEmpty() || t.namespace().equals(namespace))
+        .filter(t -> t.namespace().equals(namespace))

Review Comment:
   This looks like the correct behavior, but I think there are problems with 
the implicit existence of the empty namespace.
   
   `listTables` currently assumes that the empty namespace exists. However, to 
create a table in that namespace, you'd need to create it. We need to solve 
that problem, but probably not in this PR. For this PR, `listTables` should 
return an empty set of tables and we can clean up not needing to create the 
root/empty namespace later.



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