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



##########
File path: 
aws/src/main/java/org/apache/iceberg/aws/glue/GlueTableOperations.java
##########
@@ -111,6 +113,17 @@ protected void doRefresh() {
 
   @Override
   protected void doCommit(TableMetadata base, TableMetadata metadata) {
+    // LakeFormation credential require TableArn as input, so creating a dummy 
table
+    // beforehand for create table scenario
+    if (awsProperties.glueLakeFormationEnabled() && base == null) {
+      glue.createTable(CreateTableRequest.builder()
+          .databaseName(databaseName)
+          .tableInput(TableInput.builder()
+              .parameters(ImmutableMap.of(TABLE_TYPE_PROP, 
ICEBERG_TABLE_TYPE_VALUE))
+              .name(tableName)
+              
.storageDescriptor(StorageDescriptor.builder().location(metadata.location()).build())
+              .build()).build());
+    }
     String newMetadataLocation = writeNewMetadata(metadata, currentVersion() + 
1);

Review comment:
       I guess under the LF model this dummy table creation is the best we can 
do...
   
   This means we should move the whole block to the try catch block. When the 
execution fails, and if we created this dummy table, we should also delete it.




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