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


##########
core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java:
##########
@@ -86,6 +86,27 @@ public void loadViewWithNonExistingNamespace() {
         .hasMessageStartingWith("View does not exist: %s", ident);
   }
 
+  @Test
+  public void loadViewThatAlreadyExistsAsTable() {
+    assumeThat(tableCatalog()).as("Only valid for catalogs that support 
tables").isNotNull();
+
+    TableIdentifier tableIdentifier = TableIdentifier.of("ns", "table");
+
+    if (requiresNamespaceCreate()) {
+      catalog().createNamespace(tableIdentifier.namespace());
+    }
+
+    assertThat(tableCatalog().tableExists(tableIdentifier)).as("Table should 
not exist").isFalse();
+
+    tableCatalog().buildTable(tableIdentifier, SCHEMA).create();
+
+    assertThat(tableCatalog().tableExists(tableIdentifier)).as("Table should 
exist").isTrue();
+
+    assertThatThrownBy(() -> catalog().loadView(tableIdentifier))

Review Comment:
   it probably makes sense to also add 
`assertThat(catalog().viewExists(tableIdentifier)).as("View should not 
exist").isFalse();` right before this line



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