![](/img/trans.png)
[英]Save non-SparkDataFrame from Azure Databricks to local computer as .RData
[英]Save RData to Azure Blob Storage
我最近正在学习如何在 Azure Databricks 上使用 R 读取和写入文件到 Azure Blob 存储。 是否有关于如何将 RData 文件保存到 Azure Blob 存储的教程?
最新版本的 AzureStor 现在有一个storge_save_rdata
function:
bl <- blob_endpoint("https://myacct.blob.core.windows.net", key="mykey")
cont <- storage_container(bl, "mycontainer")
storage_save_rdata(iris, mtcars, container=cont, file="myblob.rdata")
有一种解决方案可以使用 AzureStor package 直接从 R 环境将数据帧作为 CSV 上传。
w_con <- textConnection("foo", "w")
write.csv(ds,w_con)
r_con <- textConnection(textConnectionValue(w_con))
close(w_con)
upload_blob(container, src=r_con, dest=paste0("check_",ds[1, "Claim Number"], '_',ds[1, "Claim Type"], ".csv"))
close(r_con)
有关更多详细信息,请参阅对 blob 容器或 blob 的操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.