jackye1995 commented on a change in pull request #4423:
URL: https://github.com/apache/iceberg/pull/4423#discussion_r836666148



##########
File path: aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java
##########
@@ -267,16 +267,16 @@ public boolean dropTable(TableIdentifier identifier, 
boolean purge) {
     try {
       TableOperations ops = newTableOps(identifier);
       TableMetadata lastMetadata = ops.current();
+      if (purge && lastMetadata != null) {
+        CatalogUtil.dropTableData(ops.io(), lastMetadata);
+        LOG.info("Glue table {} data purged", identifier);
+      }
       glue.deleteTable(DeleteTableRequest.builder()
           .catalogId(awsProperties.glueCatalogId())
           .databaseName(IcebergToGlueConverter.getDatabaseName(identifier))
           .name(identifier.name())
           .build());
       LOG.info("Successfully dropped table {} from Glue", identifier);
-      if (purge && lastMetadata != null) {
-        CatalogUtil.dropTableData(ops.io(), lastMetadata);
-        LOG.info("Glue table {} data purged", identifier);
-      }

Review comment:
       ah interesting, I overlooked this aspect. Does that mean when user has 
LF enabled, we must purge the table before dropping the table in Glue, 
otherwise it cannot get temporary S3 credential?
   
   If that's the case, we should make delete table in the finally block, so 
that purge failure does not impact actual table drop.




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