简体   繁体   English

无法从 Databricks 写入 Azure Cosmos DB

[英]Unable to write to Azure Cosmos DB from Databricks

I'm attempting to follow write to Azure Cosmos DB, but failing with the following error:我正在尝试跟随写入 Azure Cosmos DB,但失败并出现以下错误:

flights.write.format("com.microsoft.azure.cosmosdb.spark").options(writeConfig).save() Flights.write.format("com.microsoft.azure.cosmosdb.spark").options(writeConfig).save()

AttributeError: 'NoneType' object has no attribute 'write' AttributeError: 'NoneType' 对象没有属性 'write'

I'm using the following document as a guide:我使用以下文档作为指南:
https://docs.microsoft.com/en-us/azure/cosmos-db/spark-connector https://docs.microsoft.com/en-us/azure/cosmos-db/spark-connector

Can someone let me know where I'm going wrong?有人可以让我知道我哪里出错了吗?

First thing I would like to say if that if you follow the documentation I posted it will 100% work.首先我想说的是,如果您遵循我发布的文档,它将 100% 工作。

The reason why if failed for me was because when I originally created the Azure Cosmos DB Account I created with the "Azure Cosmos DB for MongoDB API".如果对我来说失败的原因是因为当我最初创建 Azure Cosmos DB 帐户时,我是使用“Azure Cosmos DB for MongoDB API”创建的。 I should have created it with the Core (SQL) API and selected Apache Spark Notebook, see image我应该使用 Core (SQL) API 创建它并选择 Apache Spark Notebook,参见图片在此处输入图片说明

After that I used the documentation to connect using Python and it worked first time.之后,我使用文档使用 Python 进行连接,并且第一次成功了。

I hope this helps我希望这有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有什么方法可以将数据从 azure 数据块写入 azure cosmos db GREMLIN API - Is there any way to write data from azure databricks to azure cosmos db GREMLIN API 将数据从 Azure Databricks 保存到 Cosmos DB 非常慢 - Saving data to Cosmos DB from Azure Databricks is very slow 如何使用 Azure Cosmos DB Spark 仅将不存在的记录写入 Cosmos DB? - How to write only non existing records to Cosmos DB from using Azure Cosmos DB Spark? Azure Cosmos DB 数据迁移工具无法连接到 Cosmos DB - Azure Cosmos DB Data Migration Tool unable to connect to Cosmos DB 使用Azure Cosmos DB无法查看READ的统计信息以及WRITE和ALL的统计信息错误 - Unable to view stats for READ and Wrong stats for WRITE and ALL with Azure Cosmos DB 对于Azure Cosmos DB,是否可以从单区域写入改为多区域写入? - For Azure Cosmos DB, is it possible to change from single region write to multi region write? 在 Flutter 中从 Azure Cosmos DB 获取数据? - Fetching data from Azure Cosmos DB in Flutter? 从 Azure 下载 Cosmos DB 的简单方法 - Easy way to download a Cosmos DB from Azure 如何使用 Azure Databricks 访问 Azure Cosmos DB 分析存储? - How can I access Azure Cosmos DB Analytics Store using Azure Databricks? 是否可以从Azure cosmos db进行httprequest? - Is it possible to make httprequest from Azure cosmos db?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM