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/09/13 21:00:17 UTC

[GitHub] [iceberg] jackye1995 commented on a diff in pull request #5756: AWS: Preload S3 client in GlueCatalog For LakeFormation enabled tables

jackye1995 commented on code in PR #5756:
URL: https://github.com/apache/iceberg/pull/5756#discussion_r970077968


##########
aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java:
##########
@@ -210,18 +211,30 @@ void initialize(
   @Override
   protected TableOperations newTableOps(TableIdentifier tableIdentifier) {
     if (catalogProperties != null) {
-      Map<String, String> tableSpecificCatalogProperties =
-          ImmutableMap.<String, String>builder()
-              .putAll(catalogProperties)
-              .put(
-                  AwsProperties.LAKE_FORMATION_DB_NAME,
-                  IcebergToGlueConverter.getDatabaseName(
-                      tableIdentifier, awsProperties.glueCatalogSkipNameValidation()))
-              .put(
-                  AwsProperties.LAKE_FORMATION_TABLE_NAME,
-                  IcebergToGlueConverter.getTableName(
-                      tableIdentifier, awsProperties.glueCatalogSkipNameValidation()))
-              .build();
+      Map<String, String> tableSpecificCatalogProperties = Maps.newHashMap(catalogProperties);
+      tableSpecificCatalogProperties.put(
+          AwsProperties.LAKE_FORMATION_DB_NAME,
+          IcebergToGlueConverter.getDatabaseName(
+              tableIdentifier, awsProperties.glueCatalogSkipNameValidation()));
+      tableSpecificCatalogProperties.put(
+          AwsProperties.LAKE_FORMATION_TABLE_NAME,
+          IcebergToGlueConverter.getTableName(
+              tableIdentifier, awsProperties.glueCatalogSkipNameValidation()));
+
+      if (awsProperties.glueLakeFormationEnabled()) {
+        try {
+          glue.getTable(

Review Comment:
   in that case can we only check for not found exception instead of all the glue exceptions?



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