gaborkaszab commented on code in PR #5159:
URL: https://github.com/apache/iceberg/pull/5159#discussion_r909693441


##########
mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java:
##########
@@ -212,6 +216,46 @@ public void testCreateDropTable() throws TException, 
IOException, InterruptedExc
     }
   }
 
+  // This test exercises the catalog level 'drop-full-table-folder' setting to 
see if it has an effect on
+  // dropping the full table location or not.

Review Comment:
   done



##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:
##########
@@ -171,9 +172,16 @@ public boolean dropTable(TableIdentifier identifier, 
boolean purge) {
             false /* throw NoSuchObjectException if the table doesn't exist 
*/);
         return null;
       });
-
       if (purge && lastMetadata != null) {
         CatalogUtil.dropTableData(ops.io(), lastMetadata);
+
+        boolean tableOwnsLocation = 
PropertyUtil.propertyAsBoolean(catalogProperties,
+            CatalogProperties.DROP_FULL_TABLE_FOLDER, 
CatalogProperties.DROP_FULL_TABLE_FOLDER_DEFAULT);
+        if (tableOwnsLocation) {
+          fileIO.deleteFolder(lastMetadata.location());
+
+          LOG.info("Root directory deleted for table: {}", identifier);

Review Comment:
   done



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