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


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/HiveTableTest.java:
##########
@@ -388,6 +388,41 @@ public void 
testHiveTableAndIcebergTableWithSameName(TableType tableType)
     HIVE_METASTORE_EXTENSION.metastoreClient().dropTable(DB_NAME, 
hiveTableName);
   }
 
+  @Test
+  public void testTableExists() throws TException, IOException {
+    String testTableName = "test_table_exists";
+    TableIdentifier identifier = TableIdentifier.of(DB_NAME, testTableName);
+    TableIdentifier metadataIdentifier = TableIdentifier.of(DB_NAME, 
testTableName, "partitions");
+
+    assertThat(catalog.tableExists(identifier))
+        .as("Table should not exist before create")
+        .isFalse();
+    catalog.buildTable(identifier, SCHEMA).create();
+    assertThat(catalog.tableExists(identifier)).as("Table should exist after 
create").isTrue();
+    assertThat(catalog.tableExists(metadataIdentifier))
+        .as("Metadata table should also exist")
+        .isTrue();
+
+    boolean dropped = catalog.dropTable(identifier);

Review Comment:
   generally I tried to avoid assert on statement which might have side effect 
such as drop a table, but I do observe the similar pattern in other unit tests 
so updated as suggested



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