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/04/01 22:17:52 UTC

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

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



##########
File path: aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java
##########
@@ -264,15 +265,25 @@ private boolean isGlueIcebergTable(Table table) {
 
   @Override
   public boolean dropTable(TableIdentifier identifier, boolean purge) {
+    TableOperations ops = newTableOps(identifier);
+    TableMetadata lastMetadata;
+    try {
+      lastMetadata = ops.current();
+    } catch (NoSuchKeyException ex) {
+      // S3 files already deleted, can not get S3 object through metadata location
+      lastMetadata = null;
+    }
     try {
-      TableOperations ops = newTableOps(identifier);
-      TableMetadata lastMetadata = ops.current();
       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 && awsProperties.glueLakeFormationEnabled() && lastMetadata != null) {

Review comment:
       In that case we won't be able to drop table if `purge && awsProperties.glueLakeFormationEnabled()` even S3 data is already deleted.




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