07-17-2021 04:07 PM
I want to read data from s3 access point.
I successfully accessed using boto3 client to data through s3 access point.
s3 = boto3.resource('s3')ap = s3.Bucket('arn:aws:s3:[region]:[aws account id]:accesspoint/[S3 Access Point name]')for obj in ap.objects.all(): print(obj.key) print(obj.get()['Body'].read())
I tried read access through s3 access point by pyspark.
But, I dose not access to s3 access point with error of " java.lang.NullPointerException: null uri host. This can be caused by unencoded / in the password string".
# Can't access to data
# https://[s3-accesspoint-name]-[accountid].s3-accesspoint.[region].amazonaws.com/[file path]
df = spark.read.csv('s3a://arn:aws:s3:[region]:[aws account id]:accesspoint/[S3 access point name]/[data file path]')
df.show()
How to access through the S3 Access Point to data?
S3 Access Point
https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html
02-01-2022 05:36 AM
Hi @Yutaro Ono and @Niclas Ahlqvist Lindqvist , The problem is that you have provided the arn instead of the s3 URL. The URL would be something like this (assuming access point is the bucket name):
s3://accesspoint/access-point/prefix/
There is a button in the AWS console if you are in the object or prefix, top right
Copy S3 URL
09-02-2021 06:25 AM
Hi @yutaro.ono1.558849138444763E12! My name is Kaniz, and I'm a technical moderator here. Great to meet you, and thanks for your question! Let's see if your peers on the Forum have an answer to your questions first. Or else I will follow up shortly with a response.
01-21-2022 12:58 AM
Did you get to following up on this issue, Kaniz?
02-01-2022 05:36 AM
Hi @Yutaro Ono and @Niclas Ahlqvist Lindqvist , The problem is that you have provided the arn instead of the s3 URL. The URL would be something like this (assuming access point is the bucket name):
s3://accesspoint/access-point/prefix/
There is a button in the AWS console if you are in the object or prefix, top right
Copy S3 URL
02-04-2022 12:49 PM
Hi @Niclas Ahlqvist Lindqvist and @Yutaro Ono , Were you able to resolve your issue with the help of my response?
11-10-2023 11:48 AM
I'm reaching out to seek assistance as I navigate an issue. Currently, I'm trying to read JSON files from an S3 Multi-Region Access Point using a Databricks notebook. While reading directly from the S3 bucket presents no challenges, I encounter an "java.nio.file.AccessDeniedException" error when attempting to read from the Multi-Region Access Point. Any guidance or support you can provide would be greatly appreciated.
Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections.
Click here to register and join today!
Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.