gpt4 book ai didi

python - 使用在 HDI 中运行的 python 访问 blob 存储

转载 作者:太空宇宙 更新时间:2023-11-04 05:53:32 28 4
gpt4 key购买 nike

我正在编写一个 pig 嵌入式 python 脚本,它在 HDInsights 中启动并运行。

I am attempting to add to the python part a conditional block which checks for a path in blob storage (e.g. wasb://container@account/path) and updates variables based on this check.

标准的 os.path.exists 似乎无法访问 blob 存储(或者我对文件路径使用了错误的格式)。有人对此有好运吗?

最佳答案

WASB 是一个兼容 HDFS 的文件系统,因此 Hadoop 和在 Hadoop 内部运行的东西(hive、mapreduce 等)知道如何使用它; Python 和其他操作系统没有。

如果您知道用于 HDInsight 群集的默认存储帐户/容器,您可以使用 https://github.com/Azure/azure-sdk-for-python以这种方式检查容器中是否存在 blob。 http://azure.microsoft.com/en-us/documentation/articles/storage-python-how-to-use-blob-storage/应该有关于使用它访问 blob 的信息。

关于python - 使用在 HDI 中运行的 python 访问 blob 存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28950374/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com