You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "FangYongs (via GitHub)" <gi...@apache.org> on 2023/03/31 02:01:39 UTC

[GitHub] [incubator-paimon] FangYongs commented on a diff in pull request #772: [hive] Dropping table deletes table directory to avoid schema in filesystem exists

FangYongs commented on code in PR #772:
URL: https://github.com/apache/incubator-paimon/pull/772#discussion_r1153940926


##########
paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java:
##########
@@ -208,6 +208,16 @@ public void dropTable(Identifier identifier, boolean ignoreIfNotExists)
                     identifier.getDatabaseName(), identifier.getObjectName(), true, false, true);
         } catch (TException e) {
             throw new RuntimeException("Failed to drop table " + identifier.getFullName(), e);
+        } finally {
+            // Deletes table directory to avoid schema in filesystem exists.
+            Path path = getDataTableLocation(identifier);
+            try {
+                if (fileIO.exists(path)) {
+                    fileIO.deleteDirectoryQuietly(path);

Review Comment:
   If hive client fails to `delete table` and schema in filesystem is deleted, paimon cannot delete the table in hive anymore due to the validation in line 198, will it happen?



-- 
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-unsubscribe@paimon.apache.org

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