即使实际用例是在闪亮的会话中存储数据, 为了简化目标,我已经简化了。
能否请您帮助我了解将Csv / xlsx保存到S3存储桶中需要进行哪些更改?
相关但python save a csv file into s3 bucket from pypark dataframe
library(tidyverse)
library(aws.s3)
# Authetication
aws.signature::use_credentials()
s3_bucket_link = # My s3 bucket link
df = fread("mtcars.csv")
#put object to s3
aws.s3::put_object(object = "mtcars.csv",
file = "mtcars.csv",
bucket = s3_bucket_link)
# Gives 403 or 404 error
# But when I check my S3 bucket file isnt available !!!
答案 0 :(得分:0)
library(tidyverse)
library(aws.s3)
# Authetication
aws.signature::use_credentials()
s3_bucket_link = # s3 bucket link
complete_path = # Complete S3 bucket path including folder within S3 bucket link
write.csv(mtcars,"mtcars.csv")
aws.s3::s3write_using(mtcars,
object = paste0(complete_path,"mtcars.csv"),
FUN = write.csv,
bucket = s3_bucket_link)