ebyhr commented on code in PR #16061:
URL: https://github.com/apache/iceberg/pull/16061#discussion_r3135322344


##########
core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java:
##########
@@ -429,6 +429,39 @@ public void testDropNonEmptyNamespace() {
     assertThat(catalog.namespaceExists(NS)).as("Namespace should not 
exist").isFalse();
   }
 
+  @Test
+  public void testDropNamespaceWithNestedNamespace() {
+    assumeThat(supportsNestedNamespaces())
+        .as("Only valid when the catalog supports nested namespaces")
+        .isTrue();
+
+    C catalog = catalog();
+
+    Namespace parent = Namespace.of("parent");
+    Namespace nested = Namespace.of("parent", "child");
+
+    assertThat(catalog.namespaceExists(parent)).as("Parent namespace should 
not exist").isFalse();
+    assertThat(catalog.namespaceExists(nested)).as("Nested namespace should 
not exist").isFalse();
+
+    catalog.createNamespace(parent);
+    catalog.createNamespace(nested);
+
+    assertThat(catalog.namespaceExists(parent)).as("Parent namespace should 
exist").isTrue();
+    assertThat(catalog.namespaceExists(nested)).as("Nested namespace should 
exist").isTrue();
+
+    assertThatThrownBy(() -> catalog.dropNamespace(parent))
+        .isInstanceOf(NamespaceNotEmptyException.class)
+        .hasMessageContaining("is not empty");
+
+    catalog.dropNamespace(nested);

Review Comment:
   We could check the returned value to ensure that the 
`atalog.dropNamespace(parent)` didn't delete any nested namespaces. 



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