Write data from pyspark to azure blob?

只愿长相守 提交于 2021-02-11 07:20:05

问题


I want to write dataframe from pyspark to azure blob? Any suggestions or code how to do it?

I have location and key of blob

enter image description here


回答1:


You could follow this tutorial to connector your spark dataframe with Azure Blob Storage.

Set connection info:

session.conf.set(
    "fs.azure.account.key.<storage-account-name>.blob.core.windows.net",
    "<your-storage-account-access-key>"
)

Then write data into blob storage:

sdf = session.write.parquet(
    "wasbs://<container-name>@<storage-account-name>.blob.core.windows.net/<prefix>"
)

Also,you could refer to this case:pyspark write to wasb blob storage container



来源:https://stackoverflow.com/questions/56983295/write-data-from-pyspark-to-azure-blob

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!