dramaticlly commented on code in PR #11813:
URL: https://github.com/apache/iceberg/pull/11813#discussion_r1892963410


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveViewCatalog.java:
##########
@@ -125,6 +125,34 @@ public void testHiveViewAndIcebergViewWithSameName() 
throws TException, IOExcept
         .hasMessageStartingWith("Not an iceberg view: 
hive.hivedb.test_hive_view");
   }
 
+  @Test
+  public void testHiveViewExists() {
+    String dbName = "hivedb";
+    Namespace ns = Namespace.of(dbName);
+    String viewName = "test_hive_view_exists";
+    TableIdentifier identifier = TableIdentifier.of(ns, viewName);
+    TableIdentifier invalidIdentifier = TableIdentifier.of(dbName, "invalid", 
viewName);
+    if (requiresNamespaceCreate()) {
+      catalog.createNamespace(identifier.namespace());
+    }
+
+    assertThat(catalog.viewExists(invalidIdentifier))
+        .as("Should return false on invalid view identifier")
+        .isFalse();
+    assertThat(catalog.viewExists(identifier)).as("View should not exist 
before create").isFalse();

Review Comment:
   thank you @nastra for your suggestions. I agree that a lot of viewExists 
function is covered by existing createView 
   /dropView tests. 
   
   For `identifier which is a non-iceberg view`, it seems to be covered by 
[`testHiveViewAndIcebergViewWithSameName`](https://github.com/apache/iceberg/blob/main/hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveViewCatalog.java#L94C15-L94C53)
 already, let me add the other missing scenario as well. 



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