ebyhr commented on code in PR #16096:
URL: https://github.com/apache/iceberg/pull/16096#discussion_r3151092790
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/sql/TestNamespaceSQL.java:
##########
@@ -155,6 +155,35 @@ public void testDropNonEmptyNamespace() {
sql("DROP TABLE %s.table", fullNamespace);
}
+ @TestTemplate
+ public void testDropNamespaceCascade() {
+ assumeThat(catalogName).as("Session catalog has flaky
behavior").isNotEqualTo("spark_catalog");
+ assumeThat(catalogName).as("Multi part namespace is
unsupported").isNotEqualTo("testhive");
+
+ assertThat(validationNamespaceCatalog.namespaceExists(NS))
+ .as("Namespace should not already exist")
+ .isFalse();
+
+ sql("CREATE NAMESPACE %s", fullNamespace);
+ sql("CREATE NAMESPACE %s.nested", fullNamespace);
+ sql("CREATE TABLE %s.table (id bigint) USING iceberg", fullNamespace);
+ sql("CREATE TABLE %s.nested.table (id bigint) USING iceberg",
fullNamespace);
+
+ Namespace nestedNs = Namespace.of("db", "nested");
+
+ assertThat(validationNamespaceCatalog.namespaceExists(NS)).isTrue();
+ assertThat(validationNamespaceCatalog.namespaceExists(nestedNs)).isTrue();
+ assertThat(validationCatalog.tableExists(TableIdentifier.of(NS,
"table"))).isTrue();
+ assertThat(validationCatalog.tableExists(TableIdentifier.of(nestedNs,
"table"))).isTrue();
Review Comment:
Hadoop catalog doesn't support views. That is why I updated TestViews. Left
a code comment.
--
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]