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/03/28 17:18:14 UTC

[GitHub] [iceberg] jackye1995 commented on a change in pull request #4423: AWS: Add LakeFormation Integration tests

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