ajantha-bhat commented on code in PR #5510:
URL: https://github.com/apache/iceberg/pull/5510#discussion_r944357107


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:
##########
@@ -169,10 +170,19 @@ public boolean dropTable(TableIdentifier identifier, 
boolean purge) {
 
     TableOperations ops = newTableOps(identifier);
     TableMetadata lastMetadata;
-    if (purge && ops.current() != null) {
-      lastMetadata = ops.current();
-    } else {
-      lastMetadata = null;
+    try {
+      if (purge && ops.current() != null) {
+        lastMetadata = ops.current();
+      } else {
+        lastMetadata = null;
+      }
+    } catch (Exception e) {
+      if (e instanceof NotFoundException) {
+        LOG.warn("The metadata file doesn't exist any more. Continue to drop 
the table.", e);
+        lastMetadata = null;

Review Comment:
   I am not sure if this needs to be supported.
   
   See the line 199, 
   If the `lastMetadata` is null, table files are never deleted even with purge 
= true.
   ```
   if (purge && lastMetadata != null) {
           CatalogUtil.dropTableData(ops.io(), lastMetadata);
         }
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to