QuestionQ156
Integrate an Azure Cosmos DB solutionYou have an Azure Cosmos DB for NoSQL account that contains a container named Customers.
You need to add customers to Customers by using the Azure Cosmos DB Spark Connector.
How should you complete the code?
Select
newCustomers = spark.createDataFrame((\ (“ABC001”, “ABC Corporation”, 0, True),\ (“BEL001”, “BEL Corporation”, 20000, False)))\ .toDF(“id”, “companyName”, “creditLimit”, “isOnCreditHold”) newCustomers.write\ .format \ .options(**cfg)\ .mode \ .save()
Community Discussion