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


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/HiveTableTest.java:
##########
@@ -349,8 +351,70 @@ public void testListTables() throws TException, 
IOException {
     HIVE_METASTORE_EXTENSION.metastoreClient().dropTable(DB_NAME, 
hiveTableName);
   }
 
-  private org.apache.hadoop.hive.metastore.api.Table createHiveTable(String 
hiveTableName)
-      throws IOException {
+  @Test
+  public void testHiveTableAndIcebergTableWithSameName() throws TException, 
IOException {
+    List<TableIdentifier> tableIdents = 
catalog.listTables(TABLE_IDENTIFIER.namespace());
+    assertThat(tableIdents).as("should be 1 table in namespace .").hasSize(1);
+
+    // create a hive table
+    String hiveTableName = "test_hive_table";
+    org.apache.hadoop.hive.metastore.api.Table hiveTable =
+        createHiveTable(hiveTableName, TableType.EXTERNAL_TABLE);
+    HIVE_METASTORE_EXTENSION.metastoreClient().createTable(hiveTable);
+
+    catalog.setListAllTables(true);
+    List<TableIdentifier> tableIdents2 = 
catalog.listTables(TABLE_IDENTIFIER.namespace());
+    assertThat(tableIdents2).as("should be 2 tables in namespace 
.").hasSize(2);

Review Comment:
   this should also use `.containsExactly(..)` to check what exactly comes back



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