I could able to save data using pyspark into S3 but not sure on how to save a file stream object into S3 bucket using pyspark. I could achieve this with help of python but when Unity catalog was enabled on Databrciks it always ends up with an access denied exception.
I added a screenshot and sample code here to check for the same
%python
import requests
import json
import io
import boto3
s3_client = boto3.client('s3')
r = s3_client.put_object(Body="response.content", Bucket="bucketName", Key="fileName")
My questions are
Why able to save data into an Amazon S3 bucket using Pyspak but not with Python?
When saving data is working with pyspark then why it is not working with python? If there is a reason for it how can we save a file using pyspark?