danny0405 commented on code in PR #7940:
URL: https://github.com/apache/hudi/pull/7940#discussion_r1106613956


##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/table/catalog/TestHoodieHiveCatalog.java:
##########
@@ -207,6 +208,23 @@ public void testCreateNonHoodieTable() throws 
TableAlreadyExistException, Databa
     }
   }
 
+  @ParameterizedTest
+  @ValueSource(booleans = {true, false})
+  public void testDropTable(boolean external) throws 
TableAlreadyExistException, DatabaseNotExistException, TableNotExistException, 
IOException {
+    HoodieHiveCatalog catalog = 
HoodieCatalogTestUtils.createHiveCatalog("myCatalog", external);
+    catalog.open();
+
+    CatalogTable catalogTable = new CatalogTableImpl(schema, 
Collections.singletonMap(FactoryUtil.CONNECTOR.key(), "hudi"), "hudi table");
+    catalog.createTable(tablePath, catalogTable, false);
+    Table table = catalog.getHiveTable(tablePath);
+    assertEquals(external, 
Boolean.parseBoolean(table.getParameters().get("EXTERNAL")));
+
+    catalog.dropTable(tablePath, false);
+    Path path = new Path(table.getParameters().get(FlinkOptions.PATH.key()));
+    boolean created = StreamerUtil.fileExists(FSUtils.getFs(path, new 
Configuration()), path);
+    assertEquals(external, created);

Review Comment:
   created -> existing



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to