JingsongLi commented on code in PR #575:
URL: https://github.com/apache/flink-table-store/pull/575#discussion_r1124069564
##########
flink-table-store-hive/flink-table-store-hive-catalog/src/main/java/org/apache/flink/table/store/hive/HiveCatalog.java:
##########
@@ -241,6 +244,12 @@ public void createTable(Identifier identifier, Schema
schema, boolean ignoreIfEx
try {
client.createTable(table);
} catch (TException e) {
+ Path path = getDataTableLocation(identifier);
+ try {
+ fileIO.delete(path, true);
Review Comment:
Maybe introduce a method in `FileIO`, `deleteDirectoryQuietly`?
##########
flink-table-store-hive/flink-table-store-hive-catalog/src/test/java/org/apache/flink/table/store/hive/HiveCatalogITCase.java:
##########
@@ -527,6 +530,38 @@ public void testQuickPathInShowTables() throws Exception {
Assert.assertEquals("[]", tables.toString());
}
+ @Test
+ public void testCreateExistTableInHive() throws Exception {
+ tEnv.executeSql(
+ String.join(
+ "\n",
+ "CREATE CATALOG my_hive_custom_client WITH (",
+ " 'type' = 'table-store',",
+ " 'metastore' = 'hive',",
+ " 'uri' = '',",
+ " 'warehouse' = '" + path + "',",
+ " 'metastore.client.class' = '"
+ + TestHiveMetaStoreClient.class.getName()
Review Comment:
Can you create a new class `FailMetaStoreClient`?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]