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/15 12:21:52 UTC

[GitHub] [iceberg] singhpk234 opened a new pull request #4334: [WIP] AWS : Add support for s3 access points

singhpk234 opened a new pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334


   This tries to attempt adding support of s3 access points 
   ref : https://aws.amazon.com/s3/features/access-points/
   
   ```shell
       spark-shell \
           --conf spark.sql.catalog.test=org.apache.iceberg.spark.SparkCatalog \
           --conf spark.sql.catalog.test.warehouse=s3://my-bucket \
           --conf spark.sql.catalog.test.catalog-impl=org.apache.iceberg.aws.glue.GlueCatalog \
           --conf spark.sql.catalog.test.io-impl=org.apache.iceberg.aws.s3.S3FileIO \
           --conf spark.sql.catalog.test.s3.access-points.my-bucket=arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap
   ```
   
   The s3.access-points config provides a map of bucket to endpoint mapping for paths stored in Iceberg, so that the S3FileIO can use the access point to get the bucket instead when the mapping is configured.
   
   ---
   
   TODO : 
   - Add test cases
   


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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: [WIP] AWS : Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r827249469



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -68,6 +69,34 @@
     this.key = path;
   }
 
+  /**
+   * Creates a new S3URI in the form of scheme://bucket/key?query#fragment
+   * <p>
+   * The URI supports any valid URI schemes to be backwards compatible with s3a and s3n,
+   * and also allows users to use S3FileIO with other S3-compatible object storage services like GCS.
+   *
+   * @param location fully qualified URI
+   * @param bucketToAccessPointMapping contains mapping of bucket to access point
+   */
+  S3URI(String location, Map<String, String> bucketToAccessPointMapping) {

Review comment:
       I think the original constructor can just call `S3URI(location, ImmutableMap.of())`




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: [WIP] AWS : Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r827250118



##########
File path: aws/src/test/java/org/apache/iceberg/aws/s3/TestS3URI.java
##########
@@ -90,4 +92,17 @@ public void testValidSchemes() {
       assertEquals("path/to/file", uri.key());
     }
   }
+
+  @Test
+  public void testS3URIWithBucketToAccessPointMapping() {

Review comment:
       might be a bit hard, but is it possible to run with integration test by creating an access point on the fly?




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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828195694



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -225,6 +225,16 @@
    */
   public static final String S3_WRITE_TAGS_PREFIX = "s3.write.tags.";
 
+  /**
+   * Used by {@link S3FileIO} for access point. To set, we can pass a catalog property.
+   * <p>
+   * For more details, see https://aws.amazon.com/s3/features/access-points/
+   * <p>
+   * Example in Spark:
+   *    --conf spark.sql.catalog.test.s3.access-points.my-bucket=arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap
+   */
+  public static final String S3_ACCESS_POINTS = "s3.access-points.";

Review comment:
       If this is a prefix, can you add that to the variable name like `S3_WRITE_TAGS_PREFIX` above?




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829689156



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       cool, so to summarize, same-single-region and multi-region don't need this flag, and cross-single-region need this flag, is that right?
   
   If so, I think we should introduce this flag, because there is some performance implications in enabling this feature as the signing region is changed. We should not enable this feature by default for people who use MRAP.




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829208611



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/AwsIntegTestUtil.java
##########
@@ -47,6 +60,24 @@ public static String testBucketName() {
     return System.getenv("AWS_TEST_BUCKET");
   }
 
+  /**
+   * Get the environment variable AWS_TEST_ACCESS_POINT for a default bucket to use for testing
+   * @return bucket name
+   */
+  public static String testAccessPointName() {

Review comment:
       I think this part is not fully updated since the last comment? We don't need to get this info from environment variable, because we can just define any name we like in the test.




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830162533



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -170,6 +171,17 @@
    */
   public static final String S3FILEIO_SESSION_TOKEN = "s3.session-token";
 
+  /**
+   * Enable to make S3FileIO, to make cross-region call to the region specified in the ARN.

Review comment:
       in the ARN of an access point?




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


[GitHub] [iceberg] anuragmantri commented on a change in pull request #4334: [WIP] AWS : Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
anuragmantri commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r827345481



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -50,6 +52,19 @@
    * @param location fully qualified URI
    */
   S3URI(String location) {
+    this(location, ImmutableMap.of());
+  }
+
+  /**
+   * Creates a new S3URI in the form of scheme://bucket/key?query#fragment
+   * <p>
+   * The URI supports any valid URI schemes to be backwards compatible with s3a and s3n,
+   * and also allows users to use S3FileIO with other S3-compatible object storage services like GCS.
+   *
+   * @param location fully qualified URI
+   * @param bucketToAccessPointMapping contains mapping of bucket to access point
+   */
+  S3URI(String location, Map<String, String> bucketToAccessPointMapping) {
     Preconditions.checkNotNull(location, "Location cannot be null.");

Review comment:
       Nit: I'm not sure if `propertiesWithPrefix()` already ensures this but could you add a null check for the `bucketToAccessPointMapping` as well here. This cannot be null.




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829202045



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -444,4 +458,8 @@ public boolean isS3ChecksumEnabled() {
   public void setS3ChecksumEnabled(boolean eTagCheckEnabled) {
     this.isS3ChecksumEnabled = eTagCheckEnabled;
   }
+
+  public Map<String, String> getS3AccessPoints() {

Review comment:
       nit: prefer getter name without `get`, so `Map<String, String> s3AccessPoints()`

##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java
##########
@@ -68,6 +68,7 @@
   private MetricsContext metrics = MetricsContext.nullMetrics();
   private final AtomicBoolean isResourceClosed = new AtomicBoolean(false);
   private Set<Tag> writeTags = Sets.newHashSet();
+  private Map<String, String> bucketToAccessPointMapping = Maps.newHashMap();

Review comment:
       yes good point, let's keep as is

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/AwsIntegTestUtil.java
##########
@@ -47,6 +60,24 @@ public static String testBucketName() {
     return System.getenv("AWS_TEST_BUCKET");
   }
 
+  /**
+   * Get the environment variable AWS_TEST_ACCESS_POINT for a default bucket to use for testing
+   * @return bucket name
+   */
+  public static String testAccessPointName() {

Review comment:
       I think this part is not fully updated since the last comment? We don't need to get this info from environment variable, because we can just define any name we like in the test.

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/AwsIntegTestUtil.java
##########
@@ -47,6 +60,24 @@ public static String testBucketName() {
     return System.getenv("AWS_TEST_BUCKET");
   }
 
+  /**
+   * Get the environment variable AWS_TEST_ACCESS_POINT for a default bucket to use for testing
+   * @return bucket name
+   */
+  public static String testAccessPointName() {
+    return System.getenv("AWS_TEST_ACCESS_POINT");
+  }
+
+  /**
+   * Get AccessPointARN for a default bucket to use for testing
+   * @return access point arn
+   */
+  public static String testAccessPointARN() {

Review comment:
       if we remove `testAccessPointName`, it means this can also be removed, or moved into `TestS3FileIOIntegration`

##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -50,7 +52,24 @@
    * @param location fully qualified URI
    */
   S3URI(String location) {
+    this(location, ImmutableMap.of());
+  }
+
+  /**
+   * Creates a new S3URI in the form of scheme://(bucket|accessPoint)/key?query#fragment with additional information
+   * on accessPoints.
+   * <p>
+   * The URI supports any valid URI schemes to be backwards compatible with s3a and s3n,
+   * and also allows users to use S3FileIO with other S3-compatible object storage services like GCS.
+   * If the accessPoints contains a mapping of the given bucket used in location then the corresponding accessPoint

Review comment:
       nit: this sentence is a bit convoluted, what about "if the bucket of the location has an access point in the mapping, the access point is used to perform all the S3 operations"

##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -50,7 +52,24 @@
    * @param location fully qualified URI
    */
   S3URI(String location) {
+    this(location, ImmutableMap.of());
+  }
+
+  /**
+   * Creates a new S3URI in the form of scheme://(bucket|accessPoint)/key?query#fragment with additional information
+   * on accessPoints.
+   * <p>
+   * The URI supports any valid URI schemes to be backwards compatible with s3a and s3n,
+   * and also allows users to use S3FileIO with other S3-compatible object storage services like GCS.
+   * If the accessPoints contains a mapping of the given bucket used in location then the corresponding accessPoint

Review comment:
       nit: this sentence is a bit convoluted, what about "if the bucket in the location has an alias, the alias is used to perform all the S3 operations"

##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -50,7 +52,24 @@
    * @param location fully qualified URI
    */
   S3URI(String location) {
+    this(location, ImmutableMap.of());
+  }
+
+  /**
+   * Creates a new S3URI in the form of scheme://(bucket|accessPoint)/key?query#fragment with additional information
+   * on accessPoints.
+   * <p>
+   * The URI supports any valid URI schemes to be backwards compatible with s3a and s3n,
+   * and also allows users to use S3FileIO with other S3-compatible object storage services like GCS.
+   * If the accessPoints contains a mapping of the given bucket used in location then the corresponding accessPoint

Review comment:
       nit: this sentence is a bit convoluted, what about "if the bucket in the location has an access point in the mapping, the access point is used to perform all the S3 operations"

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       I think we also need to test cross-region endpoint, because I see this S3 client config:
   
   ```
       /**
        * Returns whether the client is allowed to make cross-region calls when an S3 Access Point ARN has a different
        * region to the one configured on the client.
        * <p>
        * @return True if a different region in the ARN can be used.
        */
       public boolean useArnRegionEnabled() {
           return useArnRegionEnabled.value();
       }
   ```
   
   Maybe we should turn this on when access point is configured. Could you check?

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       cool, so to summarize, same-single-region and multi-region don't need this flag, and cross-single-region need this flag, is that right?
   
   If so, I think we should introduce this flag, because there is some performance implications in enabling this feature as the signing region is changed. We should not enable this feature by default for people who use MRAP.

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       cool, so to summarize, same-single-region and multi-region don't need this flag, and cross-single-region need this flag, is that right?
   
   If so, I think we should introduce this flag, because there is some performance implications in enabling this feature as the signing region is changed on the fly. We should not enable this feature by default for people who use MRAP.

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       For boolean config, prefer to use `-enabled` suffix as convention. All S3 features should be under `s3.` config namespace.
   
   I think we can just follow the S3 variable name, `s3.arn-region-enabled` since S3 already gave this feature this name. We can directly link to this feature's github link in AWS SDK v2 repo as a reference. What do you think?




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830767283



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AssumeRoleAwsClientFactory.java
##########
@@ -46,12 +46,14 @@
   private int timeout;
   private String region;
   private String s3Endpoint;
+  private Boolean s3UseArnRegionEnabled;

Review comment:
       Thanks, made the changes.
   
   I overlooked it, I think `primitive` should be sufficient.




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


[GitHub] [iceberg] jackye1995 merged pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 merged pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334


   


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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829657187



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -50,7 +52,24 @@
    * @param location fully qualified URI
    */
   S3URI(String location) {
+    this(location, ImmutableMap.of());
+  }
+
+  /**
+   * Creates a new S3URI in the form of scheme://(bucket|accessPoint)/key?query#fragment with additional information
+   * on accessPoints.
+   * <p>
+   * The URI supports any valid URI schemes to be backwards compatible with s3a and s3n,
+   * and also allows users to use S3FileIO with other S3-compatible object storage services like GCS.
+   * If the accessPoints contains a mapping of the given bucket used in location then the corresponding accessPoint

Review comment:
       nit: this sentence is a bit convoluted, what about "if the bucket in the location has an access point in the mapping, the access point is used to perform all the S3 operations"

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       I think we also need to test cross-region endpoint, because I see this S3 client config:
   
   ```
       /**
        * Returns whether the client is allowed to make cross-region calls when an S3 Access Point ARN has a different
        * region to the one configured on the client.
        * <p>
        * @return True if a different region in the ARN can be used.
        */
       public boolean useArnRegionEnabled() {
           return useArnRegionEnabled.value();
       }
   ```
   
   Maybe we should turn this on when access point is configured. Could you check?




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828409541



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java
##########
@@ -68,6 +68,7 @@
   private MetricsContext metrics = MetricsContext.nullMetrics();
   private final AtomicBoolean isResourceClosed = new AtomicBoolean(false);
   private Set<Tag> writeTags = Sets.newHashSet();
+  private Map<String, String> bucketToAccessPointMapping = Maps.newHashMap();

Review comment:
       nit: variable here can just be named `accessPoints`




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829209171



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/AwsIntegTestUtil.java
##########
@@ -47,6 +60,24 @@ public static String testBucketName() {
     return System.getenv("AWS_TEST_BUCKET");
   }
 
+  /**
+   * Get the environment variable AWS_TEST_ACCESS_POINT for a default bucket to use for testing
+   * @return bucket name
+   */
+  public static String testAccessPointName() {
+    return System.getenv("AWS_TEST_ACCESS_POINT");
+  }
+
+  /**
+   * Get AccessPointARN for a default bucket to use for testing
+   * @return access point arn
+   */
+  public static String testAccessPointARN() {

Review comment:
       if we remove `testAccessPointName`, it means this can also be removed, or moved into `TestS3FileIOIntegration`




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830154757



##########
File path: build.gradle
##########
@@ -313,6 +313,7 @@ project(':iceberg-aws') {
 
     compileOnly 'software.amazon.awssdk:url-connection-client'
     compileOnly 'software.amazon.awssdk:s3'
+    compileOnly 'software.amazon.awssdk:s3control'

Review comment:
       this can be marked as a test only dependency




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829699014



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       +1, same-single-region / multi-region doesn't need this (verified this locally)
   
   should we make this flag explicit to access points`s3-acess-point.cross-single-region.enabled` or it can be as general as `s3-cross-single-region.enabled` based on that we can set this in our s3 client the required conf.




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830683570



##########
File path: aws/src/test/java/org/apache/iceberg/aws/s3/TestS3URI.java
##########
@@ -90,4 +92,17 @@ public void testValidSchemes() {
       assertEquals("path/to/file", uri.key());
     }
   }
+
+  @Test
+  public void testS3URIWithBucketToAccessPointMapping() {
+    String p1 = "s3://bucket/path/to/file?query=foo#bar";
+    Map<String, String> bucketToAccessPointMapping = ImmutableMap.of(
+        "bucket", "access-point"
+    );
+    S3URI uri1 = new S3URI(p1, bucketToAccessPointMapping);
+
+    assertEquals("access-point", uri1.bucket());

Review comment:
       There could be 2 possiblities:
   1. an ARN, something like `arn:aws:s3:region:111122223333:accesspoint/my-access-point`
   2. an alias, something like `my-access-point-aqfqprnstn7aefdfbarligizwgyfouse1a-s3alias`
   
   because of 2, the string can really be anything that satisfies the bucket regex, so it's a bit hard to validate on service side, given the fact that we do not really check for normal bucket name correctness either. I think it should be fine to delegate to the S3 service to check for name correctness.




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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830680426



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -170,6 +171,17 @@
    */
   public static final String S3FILEIO_SESSION_TOKEN = "s3.session-token";
 
+  /**
+   * Enable to make S3FileIO, to make cross-region call to the region specified in the ARN of an access point.
+   * <p>
+   * When set, the client can make a cross-region call to the region specified in the ARN of an access point,
+   * otherwise an exception will be thrown if cross-region call is tried.

Review comment:
       I think it would be more clear to say "By default, attempting to use an access point in a different region will throw an exception. When enabled, this property is allows using access points in other regions".




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: [WIP] AWS : Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r827367048



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -50,6 +52,19 @@
    * @param location fully qualified URI
    */
   S3URI(String location) {
+    this(location, ImmutableMap.of());
+  }
+
+  /**
+   * Creates a new S3URI in the form of scheme://bucket/key?query#fragment
+   * <p>
+   * The URI supports any valid URI schemes to be backwards compatible with s3a and s3n,
+   * and also allows users to use S3FileIO with other S3-compatible object storage services like GCS.
+   *
+   * @param location fully qualified URI
+   * @param bucketToAccessPointMapping contains mapping of bucket to access point
+   */
+  S3URI(String location, Map<String, String> bucketToAccessPointMapping) {
     Preconditions.checkNotNull(location, "Location cannot be null.");

Review comment:
       As per my understanding it's ensured it will return empty map rather than null in this scenario, (tested it locally as well). 
   https://github.com/apache/iceberg/blob/e9a287b7f68d8e7138c47dcb686d3709bdde402e/core/src/main/java/org/apache/iceberg/util/PropertyUtil.java#L85-L97
   
   
   I agree the on the adding the check, as this being a public method, and can be accessed in future with different code-paths, adding this check.




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828411959



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java
##########
@@ -101,17 +102,17 @@ public S3FileIO(SerializableSupplier<S3Client> s3, AwsProperties awsProperties)
 
   @Override
   public InputFile newInputFile(String path) {
-    return S3InputFile.fromLocation(path, client(), awsProperties, metrics);
+    return S3InputFile.fromLocation(path, client(), awsProperties, metrics, bucketToAccessPointMapping);
   }
 
   @Override
   public OutputFile newOutputFile(String path) {
-    return S3OutputFile.fromLocation(path, client(), awsProperties, metrics, writeTags);
+    return S3OutputFile.fromLocation(path, client(), awsProperties, metrics, writeTags, bucketToAccessPointMapping);

Review comment:
       I am thinking about this a bit, it does not really scale if we keep adding new arguments to the constructor, we will basically have 1 new factory method per release. Traditionally we have been adding all the properties directly in `awsProperties`, and we did not really evaluate that option when adding `writeTags`. We should think about this a bit, I feel it is cleaner if we move all these new fields back to `AwsProperties`, it was designed to be the extension point for new configs without changing constructors in different places? Any thoughts?




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829202045



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -444,4 +458,8 @@ public boolean isS3ChecksumEnabled() {
   public void setS3ChecksumEnabled(boolean eTagCheckEnabled) {
     this.isS3ChecksumEnabled = eTagCheckEnabled;
   }
+
+  public Map<String, String> getS3AccessPoints() {

Review comment:
       nit: prefer getter name without `get`, so `Map<String, String> s3AccessPoints()`




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829703375



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       For boolean config, prefer to use `-enabled` suffix as convention. All S3 features should be under `s3.` config namespace.
   
   I think we can just follow the S3 variable name, `s3.arn-region-enabled` since S3 already gave this feature this name. We can directly link to this feature's github link in AWS SDK v2 repo as a reference. What do you think?




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829680614



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       Thanks @jackye1995 , was not aware of this conf 
   - by configured you mean there is a s3bucketToAccessPoint is not empty or introducing a flag to enable this feature.
   - From the looks of this, it looks like it would be required trying out a quick test case for the same.




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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830679807



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AssumeRoleAwsClientFactory.java
##########
@@ -46,12 +46,14 @@
   private int timeout;
   private String region;
   private String s3Endpoint;
+  private Boolean s3UseArnRegionEnabled;

Review comment:
       Why is this boxed?




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829680614



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       - by configured you mean there is a s3bucketToAccessPoint is not empty or introducing a flag to enable this feature.
   - From the looks of this, it looks like it would be required trying out a quick test case for the same.




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828791976



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -116,6 +137,18 @@ public void testNewOutputStream() throws Exception {
     Assert.assertEquals(content, result);
   }
 
+  @Test
+  public void testNewOutputStreamWithAccessPoint() throws Exception {

Review comment:
       yes this should work out of box, tested mrap locally it works 




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: [WIP] AWS : Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r827304255



##########
File path: aws/src/test/java/org/apache/iceberg/aws/s3/TestS3URI.java
##########
@@ -90,4 +92,17 @@ public void testValidSchemes() {
       assertEquals("path/to/file", uri.key());
     }
   }
+
+  @Test
+  public void testS3URIWithBucketToAccessPointMapping() {

Review comment:
       I am thinking of finding a way to do that, As per my understanding this would require creating a `S3ControlClient` as per https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3control/S3ControlClient.html#createAccessPoint-- which available at sdk version >= `2.17.149` tried searching it my intellij maybe at present version (`2.17.131`) it's available with diff name if present. S3MockRule at present doesn't have a way to test this atleast from what I can say which is what is used in the `Tests3OutputStream`
   
   once the above is sorted I believe it rest of stuff should be easy to follow.




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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828195275



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -225,6 +225,16 @@
    */
   public static final String S3_WRITE_TAGS_PREFIX = "s3.write.tags.";
 
+  /**
+   * Used by {@link S3FileIO} for access point. To set, we can pass a catalog property.
+   * <p>
+   * For more details, see https://aws.amazon.com/s3/features/access-points/
+   * <p>
+   * Example in Spark:
+   *    --conf spark.sql.catalog.test.s3.access-points.my-bucket=arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap

Review comment:
       I would probably not include a Spark-specific example. Instead, just show configuration from the catalog level, like `s3.access-points.my-bucket=...`.




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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830681234



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -50,7 +52,24 @@
    * @param location fully qualified URI
    */
   S3URI(String location) {
+    this(location, ImmutableMap.of());
+  }
+
+  /**
+   * Creates a new S3URI in the form of scheme://(bucket|accessPoint)/key?query#fragment with additional information
+   * on accessPoints.
+   * <p>
+   * The URI supports any valid URI schemes to be backwards compatible with s3a and s3n,
+   * and also allows users to use S3FileIO with other S3-compatible object storage services like GCS.
+   * If the bucket in the location has an access point in the mapping, the access point is used to perform all the S3
+   * operations
+   *
+   * @param location fully qualified URI
+   * @param bucketToAccessPointMapping contains mapping of bucket to access point
+   */
+  S3URI(String location, Map<String, String> bucketToAccessPointMapping) {
     Preconditions.checkNotNull(location, "Location cannot be null.");
+    Preconditions.checkNotNull(bucketToAccessPointMapping, "BucketToAccessPointMapping cannot be null.");

Review comment:
       This error message probably doesn't make sense to people that will see it. We avoid using variable or class names in error messages because users aren't familiar with Iceberg code internal details.
   
   In addition, I don't think there's anything the user would be able to do about this because the mapping is created by AWS code. Instead, I think this should just default the mapping to an empty immutable map.




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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830681471



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -50,7 +52,24 @@
    * @param location fully qualified URI
    */
   S3URI(String location) {
+    this(location, ImmutableMap.of());
+  }
+
+  /**
+   * Creates a new S3URI in the form of scheme://(bucket|accessPoint)/key?query#fragment with additional information
+   * on accessPoints.
+   * <p>
+   * The URI supports any valid URI schemes to be backwards compatible with s3a and s3n,
+   * and also allows users to use S3FileIO with other S3-compatible object storage services like GCS.
+   * If the bucket in the location has an access point in the mapping, the access point is used to perform all the S3
+   * operations

Review comment:
       This looks like class documentation, not constructor documentation.




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830161492



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -106,6 +132,33 @@ public void testNewInputStream() throws Exception {
     validateRead(s3FileIO);
   }
 
+  @Test
+  public void testNewInputStreamWithAccessPoint() throws Exception {
+    s3.putObject(PutObjectRequest.builder().bucket(bucketName).key(objectKey).build(),
+        RequestBody.fromBytes(contentBytes));
+    S3FileIO s3FileIO = new S3FileIO(clientFactory::s3);
+    s3FileIO.initialize(ImmutableMap.of(AwsProperties.S3_ACCESS_POINTS_PREFIX + bucketName,
+        testAccessPointARN(AwsIntegTestUtil.testRegion(), accessPointName)));
+    validateRead(s3FileIO);
+  }
+
+  @Test
+  public void testNewInputStreamWithCrossRegionAccessPoint() throws Exception {

Review comment:
       Just a side note that in https://github.com/aws/aws-sdk-java-v2/commit/51632cb58491e13f1d88e636353d4ce87b34e81d, a new config `multiRegionEnabled` is added, which defaults to true and controls cross-region access when using MRAP. The default works for us, so we probably don't need to add it for now.




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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830680577



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -254,6 +266,15 @@
    */
   public static final String S3_WRITE_TAGS_PREFIX = "s3.write.tags.";
 
+  /**
+   * Used by {@link S3FileIO} for access point. To set, we can pass a catalog property.
+   * <p>
+   * For more details, see https://aws.amazon.com/s3/features/access-points/
+   * <p>
+   * Example : s3.access-points.my-bucket=arn:aws:s3:region:account-id:accesspoint/resource

Review comment:
       I don't think that this context needs to be repeated in multiple places.




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


[GitHub] [iceberg] rajarshisarkar commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rajarshisarkar commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828779712



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java
##########
@@ -101,17 +102,17 @@ public S3FileIO(SerializableSupplier<S3Client> s3, AwsProperties awsProperties)
 
   @Override
   public InputFile newInputFile(String path) {
-    return S3InputFile.fromLocation(path, client(), awsProperties, metrics);
+    return S3InputFile.fromLocation(path, client(), awsProperties, metrics, bucketToAccessPointMapping);
   }
 
   @Override
   public OutputFile newOutputFile(String path) {
-    return S3OutputFile.fromLocation(path, client(), awsProperties, metrics, writeTags);
+    return S3OutputFile.fromLocation(path, client(), awsProperties, metrics, writeTags, bucketToAccessPointMapping);

Review comment:
       I have published the PR: https://github.com/apache/iceberg/pull/4350




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828760966



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -78,17 +83,23 @@ public static void beforeClass() {
     clientFactory = AwsClientFactories.defaultFactory();
     s3 = clientFactory.s3();
     kms = clientFactory.kms();
+    s3Control = clientFactory.s3Control();
     bucketName = AwsIntegTestUtil.testBucketName();
+    accountId = AwsIntegTestUtil.testAccountId();
+    accessPointName = AwsIntegTestUtil.testAccessPointName();
     prefix = UUID.randomUUID().toString();
     contentBytes = new byte[1024 * 1024 * 10];
     deletionBatchSize = 3;
     content = new String(contentBytes, StandardCharsets.UTF_8);
     kmsKeyArn = kms.createKey().keyMetadata().arn();
+
+    AwsIntegTestUtil.createAccessPoint(s3Control, accessPointName, bucketName, accountId);

Review comment:
       yes , we can and these arguments are indeed not required in the present set-up can be directly accessed in the Util class itself.




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828760076



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java
##########
@@ -101,17 +102,17 @@ public S3FileIO(SerializableSupplier<S3Client> s3, AwsProperties awsProperties)
 
   @Override
   public InputFile newInputFile(String path) {
-    return S3InputFile.fromLocation(path, client(), awsProperties, metrics);
+    return S3InputFile.fromLocation(path, client(), awsProperties, metrics, bucketToAccessPointMapping);
   }
 
   @Override
   public OutputFile newOutputFile(String path) {
-    return S3OutputFile.fromLocation(path, client(), awsProperties, metrics, writeTags);
+    return S3OutputFile.fromLocation(path, client(), awsProperties, metrics, writeTags, bucketToAccessPointMapping);

Review comment:
       +1, Agree with this, changing constructors definitely doesn't seems to be scalable. 




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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830680862



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -290,6 +312,7 @@ public AwsProperties() {
     this.s3fileIoStagingDirectory = System.getProperty("java.io.tmpdir");
     this.isS3ChecksumEnabled = S3_CHECKSUM_ENABLED_DEFAULT;
     this.s3WriteTags = Sets.newHashSet();
+    this.s3BucketToAccessPointMapping = Maps.newHashMap();

Review comment:
       Why not use an immutable map instead?




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


[GitHub] [iceberg] jackye1995 commented on pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#issuecomment-1077138894


   This looks good to me, and I think there has been no comment for a few days, I will merge it to unblock other feature contributions, and for people to test out the access point usages. @rdblue @rajarshisarkar let us know if you have any additional concern, we can address before the upcoming release.


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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: [WIP] AWS : Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r827258124



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3OutputFile.java
##########
@@ -43,6 +44,11 @@ public static S3OutputFile fromLocation(String location, S3Client client, AwsPro
     return new S3OutputFile(client, new S3URI(location), awsProperties, metrics, writeTags);
   }
 
+  public static S3OutputFile fromLocation(String location, S3Client client, AwsProperties awsProperties,

Review comment:
       the `fromLocation` at L42 was just added, not released yet, we can just update that method to also include this new field instead of creating a new static helper.




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


[GitHub] [iceberg] jackye1995 commented on pull request #4334: [WIP] AWS : Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#issuecomment-1068278265


   FYI @flyrain @anuragmantri, this is based on our discussion in https://apache-iceberg.slack.com/archives/C025PH0G1D4/p1645066803099319


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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828414029



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -78,17 +83,23 @@ public static void beforeClass() {
     clientFactory = AwsClientFactories.defaultFactory();
     s3 = clientFactory.s3();
     kms = clientFactory.kms();
+    s3Control = clientFactory.s3Control();
     bucketName = AwsIntegTestUtil.testBucketName();
+    accountId = AwsIntegTestUtil.testAccountId();
+    accessPointName = AwsIntegTestUtil.testAccessPointName();
     prefix = UUID.randomUUID().toString();
     contentBytes = new byte[1024 * 1024 * 10];
     deletionBatchSize = 3;
     content = new String(contentBytes, StandardCharsets.UTF_8);
     kmsKeyArn = kms.createKey().keyMetadata().arn();
+
+    AwsIntegTestUtil.createAccessPoint(s3Control, accessPointName, bucketName, accountId);

Review comment:
       if we are creating the access points on the fly, why do we still need those environment variables? Can't we just define the `accessPointName` in tests?




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: [WIP] AWS : Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r827367048



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -50,6 +52,19 @@
    * @param location fully qualified URI
    */
   S3URI(String location) {
+    this(location, ImmutableMap.of());
+  }
+
+  /**
+   * Creates a new S3URI in the form of scheme://bucket/key?query#fragment
+   * <p>
+   * The URI supports any valid URI schemes to be backwards compatible with s3a and s3n,
+   * and also allows users to use S3FileIO with other S3-compatible object storage services like GCS.
+   *
+   * @param location fully qualified URI
+   * @param bucketToAccessPointMapping contains mapping of bucket to access point
+   */
+  S3URI(String location, Map<String, String> bucketToAccessPointMapping) {
     Preconditions.checkNotNull(location, "Location cannot be null.");

Review comment:
       As per my understanding it's ensured it will return empty map rather than null in this scenario, (tested it locally as well). 
   https://github.com/apache/iceberg/blob/e9a287b7f68d8e7138c47dcb686d3709bdde402e/core/src/main/java/org/apache/iceberg/util/PropertyUtil.java#L85-L97
   
   
   I agree on  adding the check, as this being a public method, and can be accessed in future with different code-paths, adding this check.




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828413175



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/AwsIntegTestUtil.java
##########
@@ -47,6 +58,23 @@ public static String testBucketName() {
     return System.getenv("AWS_TEST_BUCKET");
   }
 
+  /**
+   * Get the environment variable AWS_TEST_ACCESS_POINT for a default bucket to use for testing
+   * @return bucket name
+   */
+  public static String testAccessPointName() {
+    return System.getenv("AWS_TEST_ACCESS_POINT");
+  }
+
+  /**
+   * Get AccessPointARN for a default bucket to use for testing
+   * @return access point arn
+   */
+  public static String testAccessPointARN() {
+    // format : arn:aws:s3:region:account-id:accesspoint/resource
+    return String.format("arn:aws:s3:%s:%s:accesspoint/%s", testRegion(), testAccountId(), testAccessPointName());

Review comment:
       partition is not always `aws`, should use `PartitionMetadata.of(region)` to get the partition value




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829655433



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -50,7 +52,24 @@
    * @param location fully qualified URI
    */
   S3URI(String location) {
+    this(location, ImmutableMap.of());
+  }
+
+  /**
+   * Creates a new S3URI in the form of scheme://(bucket|accessPoint)/key?query#fragment with additional information
+   * on accessPoints.
+   * <p>
+   * The URI supports any valid URI schemes to be backwards compatible with s3a and s3n,
+   * and also allows users to use S3FileIO with other S3-compatible object storage services like GCS.
+   * If the accessPoints contains a mapping of the given bucket used in location then the corresponding accessPoint

Review comment:
       nit: this sentence is a bit convoluted, what about "if the bucket in the location has an alias, the alias is used to perform all the S3 operations"




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829689156



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       cool, so to summarize, same-single-region and multi-region don't need this flag, and cross-single-region need this flag, is that right?
   
   If so, I think we should introduce this flag, because there is some performance implications in enabling this feature as the signing region is changed on the fly. We should not enable this feature by default for people who use MRAP.




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


[GitHub] [iceberg] rajarshisarkar commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rajarshisarkar commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828753812



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java
##########
@@ -101,17 +102,17 @@ public S3FileIO(SerializableSupplier<S3Client> s3, AwsProperties awsProperties)
 
   @Override
   public InputFile newInputFile(String path) {
-    return S3InputFile.fromLocation(path, client(), awsProperties, metrics);
+    return S3InputFile.fromLocation(path, client(), awsProperties, metrics, bucketToAccessPointMapping);
   }
 
   @Override
   public OutputFile newOutputFile(String path) {
-    return S3OutputFile.fromLocation(path, client(), awsProperties, metrics, writeTags);
+    return S3OutputFile.fromLocation(path, client(), awsProperties, metrics, writeTags, bucketToAccessPointMapping);

Review comment:
       I agree with this, this should avoid changes to the constructor (or) introducing a new one. I will publish the PR for moving the new fields to `AwsProperties`. Thanks, for bringing this up.




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830766244



##########
File path: aws/src/test/java/org/apache/iceberg/aws/TestAwsClientFactories.java
##########
@@ -34,7 +34,6 @@
 import software.amazon.awssdk.services.kms.KmsClient;
 import software.amazon.awssdk.services.s3.S3Client;
 
-

Review comment:
       Thanks, noted and made the changes.




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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830680066



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -170,6 +171,17 @@
    */
   public static final String S3FILEIO_SESSION_TOKEN = "s3.session-token";
 
+  /**
+   * Enable to make S3FileIO, to make cross-region call to the region specified in the ARN of an access point.
+   * <p>
+   * When set, the client can make a cross-region call to the region specified in the ARN of an access point,
+   * otherwise an exception will be thrown if cross-region call is tried.
+   *
+   * For more details see : https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3/S3Configuration.html#useArnRegionEnabled--

Review comment:
       Typo: `:` should not have a space before 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: 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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830681539



##########
File path: aws/src/test/java/org/apache/iceberg/aws/TestAwsClientFactories.java
##########
@@ -34,7 +34,6 @@
 import software.amazon.awssdk.services.kms.KmsClient;
 import software.amazon.awssdk.services.s3.S3Client;
 
-

Review comment:
       Please revert this change. We avoid changes that are unnecessary and could cause merge failures.




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830149855



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsClientFactory.java
##########
@@ -56,6 +57,12 @@
    */
   DynamoDbClient dynamo();
 
+  /**
+   * Create a Amazon S3Control client
+   * @return s3Control client
+   */
+  S3ControlClient s3Control();

Review comment:
       I think we no longer need this in the client factory? It is for test only and we already have a method there to create s3 control client.




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830163316



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -170,6 +171,17 @@
    */
   public static final String S3FILEIO_SESSION_TOKEN = "s3.session-token";
 
+  /**
+   * Enable to make S3FileIO, to make cross-region call to the region specified in the ARN.
+   * <p>
+   * When set, the client can make a cross-region call to the region specified in the ARN,
+   * otherwise an exception will be thrown if cross-region call is tried.
+   *
+   * For more details see : https://github.com/aws/aws-sdk-java-v2/blob/master/services/s3/src/main/java/software/amazon/awssdk/services/s3/S3Configuration.java#L186
+   */
+  public static final String S3_ARN_REGION_ENABLED = "s3.arn-region-enabled";

Review comment:
       Sorry I just notice the name in S3Configuration is `useArnRegionEnabled`, I think we should map the name exactly to the s3 to call it `s3.use-arn-region-enabled`




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r832898290



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +366,10 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN(String region, String accessPoint) {
+    // format : arn:aws:s3:region:account-id:accesspoint/resource

Review comment:
       nit: no space before `:`

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +366,10 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN(String region, String accessPoint) {
+    // format : arn:aws:s3:region:account-id:accesspoint/resource

Review comment:
       nit: no space before `:`




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r832897960



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -170,6 +171,17 @@
    */
   public static final String S3FILEIO_SESSION_TOKEN = "s3.session-token";
 
+  /**
+   * Enable to make S3FileIO, to make cross-region call to the region specified in the ARN of an access point.
+   * <p>
+   * By default, attempting to use an access point in a different region will throw an exception.
+   * When enabled, this property allows using access points in other regions.
+   *

Review comment:
       nit: <p> missing




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r832897956



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -170,6 +171,17 @@
    */
   public static final String S3FILEIO_SESSION_TOKEN = "s3.session-token";
 
+  /**
+   * Enable to make S3FileIO, to make cross-region call to the region specified in the ARN of an access point.
+   * <p>
+   * By default, attempting to use an access point in a different region will throw an exception.
+   * When enabled, this property allows using access points in other regions.
+   *

Review comment:
       nit: <p> missing

##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -170,6 +171,17 @@
    */
   public static final String S3FILEIO_SESSION_TOKEN = "s3.session-token";
 
+  /**
+   * Enable to make S3FileIO, to make cross-region call to the region specified in the ARN of an access point.
+   * <p>
+   * By default, attempting to use an access point in a different region will throw an exception.
+   * When enabled, this property allows using access points in other regions.
+   *

Review comment:
       nit: <p> missing




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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830680553



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -254,6 +266,15 @@
    */
   public static final String S3_WRITE_TAGS_PREFIX = "s3.write.tags.";
 
+  /**
+   * Used by {@link S3FileIO} for access point. To set, we can pass a catalog property.

Review comment:
       I'm not sure what this is saying. Do you mean "prefix used for bucket access point configuration"?




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829682919



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       I tried this and it failed with "java.lang.IllegalArgumentException: The region field of the ARN being passed as a bucket parameter to an S3 operation does not match the region the client was configured with. To enable this behavior and prevent this exception set 'useArnRegionEnabled' to true in the configuration when building the S3 client. Provided region: 'us-east-2'; client region: 'us-east-1'."
   
   Looks like we need to set this 




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828799949



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java
##########
@@ -68,6 +68,7 @@
   private MetricsContext metrics = MetricsContext.nullMetrics();
   private final AtomicBoolean isResourceClosed = new AtomicBoolean(false);
   private Set<Tag> writeTags = Sets.newHashSet();
+  private Map<String, String> bucketToAccessPointMapping = Maps.newHashMap();

Review comment:
       I agree with this,  but by naming it accessPoints at first glance could mean just a collection of access points where as here what we actually have  is a mapping from s3 bucket to accessPoint, if this rational makes sense I would like to keep it as its.. WDYT ? 




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829655433



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -50,7 +52,24 @@
    * @param location fully qualified URI
    */
   S3URI(String location) {
+    this(location, ImmutableMap.of());
+  }
+
+  /**
+   * Creates a new S3URI in the form of scheme://(bucket|accessPoint)/key?query#fragment with additional information
+   * on accessPoints.
+   * <p>
+   * The URI supports any valid URI schemes to be backwards compatible with s3a and s3n,
+   * and also allows users to use S3FileIO with other S3-compatible object storage services like GCS.
+   * If the accessPoints contains a mapping of the given bucket used in location then the corresponding accessPoint

Review comment:
       nit: this sentence is a bit convoluted, what about "if the bucket of the location has an access point in the mapping, the access point is used to perform all the S3 operations"




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: [WIP] AWS : Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r827304255



##########
File path: aws/src/test/java/org/apache/iceberg/aws/s3/TestS3URI.java
##########
@@ -90,4 +92,17 @@ public void testValidSchemes() {
       assertEquals("path/to/file", uri.key());
     }
   }
+
+  @Test
+  public void testS3URIWithBucketToAccessPointMapping() {

Review comment:
       +1 I am still thinking of finding a way to do that, As per my understanding this would require creating a `S3ControlClient` as per https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3control/S3ControlClient.html#createAccessPoint-- which available at sdk version >= `2.17.149` tried searching it my intellij maybe at present version (`2.17.131`) it's available with diff name if present. S3MockRule at present doesn't have a way to test this atleast from what I can say which is what is used in the `Tests3OutputStream.




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829680614



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       - by configured you mean there is a s3bucketToAccessPoint is not empty or introducing a flag to enable this feature.
   - From the looks of this, it looks like it would be required trying out a quick test case for the same.

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       Thanks @jackye1995 , was not aware of this conf 
   - by configured you mean there is a s3bucketToAccessPoint is not empty or introducing a flag to enable this feature.
   - From the looks of this, it looks like it would be required trying out a quick test case for the same.

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       I tried this and it failed with "java.lang.IllegalArgumentException: The region field of the ARN being passed as a bucket parameter to an S3 operation does not match the region the client was configured with. To enable this behavior and prevent this exception set 'useArnRegionEnabled' to true in the configuration when building the S3 client. Provided region: 'us-east-2'; client region: 'us-east-1'."
   
   Looks like we need to set this 

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       I tried this and it failed with _`"java.lang.IllegalArgumentException: The region field of the ARN being passed as a bucket parameter to an S3 operation does not match the region the client was configured with. To enable this behavior and prevent this exception set 'useArnRegionEnabled' to true in the configuration when building the S3 client. Provided region: 'us-east-2'; client region: 'us-east-1'."`_
   
   Looks like we need to set this 

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       +1, same-single-region / multi-region doesn't need this (verified this locally)
   
   should we make this flag explicit to access points`s3-acess-point.cross-single-region.enabled` or it can be as general as `s3-cross-single-region.enabled` based on that we can set this in our s3 client the required conf.

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       This makes sense, having such a name and linking it to the direct AWS SDK v2 repo as a reference adds more value. Let me make the changes.

##########
File path: aws/src/integration/java/org/apache/iceberg/aws/AwsIntegTestUtil.java
##########
@@ -81,4 +114,38 @@ public static void cleanGlueCatalog(GlueClient glue, List<String> namespaces) {
       }
     }
   }
+
+  public static S3ControlClient createCrossRegionS3ControlClient() {
+    return S3ControlClient.builder()
+        .httpClientBuilder(UrlConnectionHttpClient.builder())
+        .region(Region.of(testCrossRegion()))
+        .build();
+  }

Review comment:
       [rational] This is required to create cross-region access point as S3ControlClient has a validation within that it will allow creating AccessPoint in the region where the S3ControlClient is configured.
   
   Didn't add this in the factory rather added here as didn't wanted to change public interface to expose setting region 




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829207096



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java
##########
@@ -68,6 +68,7 @@
   private MetricsContext metrics = MetricsContext.nullMetrics();
   private final AtomicBoolean isResourceClosed = new AtomicBoolean(false);
   private Set<Tag> writeTags = Sets.newHashSet();
+  private Map<String, String> bucketToAccessPointMapping = Maps.newHashMap();

Review comment:
       yes good point, let's keep as is




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829720663



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       This makes sense, having such a name and linking it to the direct AWS SDK v2 repo as a reference adds more value. Let me make the changes.




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830151450



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -170,6 +171,17 @@
    */
   public static final String S3FILEIO_SESSION_TOKEN = "s3.session-token";
 
+  /**
+   * Enable to make S3FileIO, to make cross-region call to the region specified in the ARN.
+   * <p>
+   * When set, the client can make a cross-region call to the region specified in the ARN,
+   * otherwise an exception will be thrown if cross-region call is tried.
+   *
+   * For more details see : https://github.com/aws/aws-sdk-java-v2/blob/master/services/s3/src/main/java/software/amazon/awssdk/services/s3/S3Configuration.java#L186

Review comment:
       line number might change, linking to the github code is probably a bad idea, sorry for the bad suggestion. We can link to this: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3/S3Configuration.html#useArnRegionEnabled--




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


[GitHub] [iceberg] singhpk234 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
singhpk234 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r829682919



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -268,4 +306,11 @@ private void validateRead(S3FileIO s3FileIO) throws Exception {
     stream.close();
     Assert.assertEquals(content, result);
   }
+
+  private String testAccessPointARN() {

Review comment:
       I tried this and it failed with _`"java.lang.IllegalArgumentException: The region field of the ARN being passed as a bucket parameter to an S3 operation does not match the region the client was configured with. To enable this behavior and prevent this exception set 'useArnRegionEnabled' to true in the configuration when building the S3 client. Provided region: 'us-east-2'; client region: 'us-east-1'."`_
   
   Looks like we need to set this 




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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830681624



##########
File path: aws/src/test/java/org/apache/iceberg/aws/s3/TestS3URI.java
##########
@@ -90,4 +92,17 @@ public void testValidSchemes() {
       assertEquals("path/to/file", uri.key());
     }
   }
+
+  @Test
+  public void testS3URIWithBucketToAccessPointMapping() {
+    String p1 = "s3://bucket/path/to/file?query=foo#bar";
+    Map<String, String> bucketToAccessPointMapping = ImmutableMap.of(
+        "bucket", "access-point"
+    );
+    S3URI uri1 = new S3URI(p1, bucketToAccessPointMapping);
+
+    assertEquals("access-point", uri1.bucket());

Review comment:
       Should there be any validation that the access point is in a valid format? Or is that handled by the SDK and we don't want to duplicate logic?




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


[GitHub] [iceberg] rdblue commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r830680553



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -254,6 +266,15 @@
    */
   public static final String S3_WRITE_TAGS_PREFIX = "s3.write.tags.";
 
+  /**
+   * Used by {@link S3FileIO} for access point. To set, we can pass a catalog property.

Review comment:
       I'm not sure what this is saying. Do you mean "prefix used for access point configuration"?




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r832897956



##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
##########
@@ -170,6 +171,17 @@
    */
   public static final String S3FILEIO_SESSION_TOKEN = "s3.session-token";
 
+  /**
+   * Enable to make S3FileIO, to make cross-region call to the region specified in the ARN of an access point.
+   * <p>
+   * By default, attempting to use an access point in a different region will throw an exception.
+   * When enabled, this property allows using access points in other regions.
+   *

Review comment:
       nit:`<p>` missing




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828404553



##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
##########
@@ -50,7 +52,21 @@
    * @param location fully qualified URI
    */
   S3URI(String location) {
+    this(location, ImmutableMap.of());
+  }
+
+  /**
+   * Creates a new S3URI in the form of scheme://bucket/key?query#fragment

Review comment:
       the javadoc here does not really explain the additional mapping information. I think  the javadoc can be removed if they are duplicated, or we explain it as "Create a new S3URI with additional information of bucket to access point mapping"




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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #4334: AWS: Add support for s3 access points

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #4334:
URL: https://github.com/apache/iceberg/pull/4334#discussion_r828415983



##########
File path: aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOIntegration.java
##########
@@ -116,6 +137,18 @@ public void testNewOutputStream() throws Exception {
     Assert.assertEquals(content, result);
   }
 
+  @Test
+  public void testNewOutputStreamWithAccessPoint() throws Exception {

Review comment:
       Probably no need to test those, but I think this should work as well for multi-region access point and bucket alias, right?




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