我尝试将 pyspark 中的机器学习模型保存到 azure blob。但这给出了错误。
lr.save('wasbs:///user/remoteuser/models/')
Illegal Argument Exception: Cannot initialize WASB file system, URI authority not recognized.'
也尝试过,
m = lr.save('wasbs://'+container_name+'@'+storage_account_name+'.blob.core.windows.net/models/')
但是无法在堆栈跟踪中识别用户身份。 附: :我没有使用 Azure HDInsight。我只是使用 Databricks 和 Azure blob 存储
最佳答案
要直接从 Azure Databricks 访问 Azure Blob 存储(未安装),您必须设置帐户访问 key :
spark.conf.set(
"fs.azure.account.key.<your-storage-account-name>.blob.core.windows.net",
"<your-storage-account-access-key>")
或容器的 SAS。然后您应该能够访问 Blob 存储:
val df = spark.read.parquet("wasbs://<your-container-name>@<your-storage-account-name>.blob.core.windows.net/<your-directory-name>")
关于azure - 将 Spark ML 模型保存在 azure blob 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52702780/