You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/08/20 21:39:09 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #5510: Support delete corrupted Iceberg table

rdblue commented on code in PR #5510:
URL: https://github.com/apache/iceberg/pull/5510#discussion_r950745949


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:
##########
@@ -168,11 +169,13 @@ public boolean dropTable(TableIdentifier identifier, boolean purge) {
     String database = identifier.namespace().level(0);
 
     TableOperations ops = newTableOps(identifier);
-    TableMetadata lastMetadata;
-    if (purge && ops.current() != null) {
-      lastMetadata = ops.current();
-    } else {
-      lastMetadata = null;
+    TableMetadata lastMetadata = null;
+    try {
+      if (purge && ops.current() != null) {
+        lastMetadata = ops.current();
+      }
+    } catch (NotFoundException e) {
+      LOG.warn("The metadata file doesn't exist anymore. Continuing to drop the table.", e);

Review Comment:
   In Iceberg, log messages should be specific statements and should not speculate about underlying causes. In this case, the operations failed to load table metadata. That doesn't necessarily mean that it doesn't exist. The error should state that clearly. `Failed to load table metadata for table: %s, continuing drop without purge`



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org