Created
January 18, 2022 00:59
-
-
Save anjijava16/b7b45d7ee8e6789aaf7015b39e287508 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read data | |
dfCustomer = spark.read\ | |
.format("cosmos.oltp")\ | |
.option("spark.synapse.linkedService", "AdventureWorksSQL")\ | |
.option("spark.cosmos.container", "Customer")\ | |
.load() | |
display(dfCustomer.limit(10)) | |
# Write data | |
dfSalesOrderStatistic.write\ | |
.format("cosmos.oltp")\ | |
.option("spark.synapse.linkedService", "AdventureWorksSQL")\ | |
.option("spark.cosmos.container", "Sales")\ | |
.option("spark.cosmos.write.upsertEnabled", "true")\ | |
.mode('append')\ | |
.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment