You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/synapse-analytics/synapse-link/how-to-query-analytical-store-spark.md
+16-5Lines changed: 16 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Query Azure Cosmos DB analytical store with Synapse Spark
2
+
title: Query Azure Cosmos DB Analytical Store with Synapse Spark
3
3
description: How to query Cosmos DB analytical with Synapse Spark
4
4
services: synapse-analytics
5
5
author: ArnoMicrosoft
@@ -11,15 +11,23 @@ ms.author: acomet
11
11
ms.reviewer: jrasnick
12
12
---
13
13
14
-
# Query Azure Cosmos DB analytical store with Synapse Spark
14
+
# Query Azure Cosmos DB Analytical Store with Synapse Spark
15
15
16
+
<<<<<<< HEAD
16
17
This article gives some examples on how you can interact with the analytical store from Synapse gestures. Gestures are visible when you right-click on a container. With gestures, you can quickly generate code and tailor it to your needs. Gestures are also perfect for discovering data with a single click.
17
18
18
19
## Load to DataFrame
19
20
20
21
In this step, you'll read data from Azure Cosmos DB analytical store in a Spark DataFrame. It will display 10 rows from the DataFrame called ***df***. Once your data is into dataframe, you can perform additional analysis.
21
22
22
23
This operation doesn't impact the transactional store.
24
+
=======
25
+
This article gives some examples on how you can interact with the Analytical Store from Synapse gestures. Those gestures are visible when you right-click on a container. With gestures, you can quickly generate code and tweak it to your needs. They are also perfect for discovering data with a single click.
26
+
27
+
## Load to DataFrame
28
+
29
+
In this step, you will read data from Azure Cosmos DB Analytical Store in a Spark DataFrame. It will display 10 rows from the DataFrame called ***df***. Once your data is in a dataframe, you can perform additional analysis. This operation does not impact the transactional store.
30
+
>>>>>>> a72a67c843c85b268d781aa2bf780e4f89f646aa
23
31
24
32
```python
25
33
# To select a preferred list of regions in a multi-region Cosmos DB account, add .option("spark.cosmos.preferredRegions", "<Region1>,<Region2>")
@@ -44,9 +52,13 @@ val df_olap = spark.read.format("cosmos.olap").
44
52
45
53
## Create Spark table
46
54
55
+
<<<<<<< HEAD
47
56
In this gesture, you'll create a Spark table pointing to the container you selected. That operation doesn't incur any data movement. If you decide to delete that table, the underlying container (and corresponding analytical store) won't be impacted.
48
57
49
58
This scenario is convenient to reuse tables through third-party tools and provide accessibility to the data for the run-time.
59
+
=======
60
+
In this gesture, you will create a Spark table pointing to the container you selected. This operation does not incur any data movement. If you decide to delete the table, the underlying container (and corresponding Analytical Store) won't be impacted. This scenario is convenient to reuse tables through third-party tools and provide accessibility to the data at run-time.
In this gesture, you'll write a dataframe into a container. This operation will impact the transactional performance and consume Request Units. Using Azure Cosmos DB transactional performance is ideal for write transactions.
63
74
64
-
Make sure that you replace **YOURDATAFRAME** by the dataframe that you want to write back.
75
+
In this gesture, you will write a dataframe into a container. This operation will impact the transactional performance and consume Request Units. Using Azure Cosmos DB transactional performance is ideal for write transactions. Make sure that you replace **YOURDATAFRAME** by the dataframe that you want to write back to.
65
76
66
77
```python
67
78
# Write a Spark DataFrame into a Cosmos DB container
@@ -162,4 +173,4 @@ query.awaitTermination()
162
173
## Next steps
163
174
164
175
*[Learn what is supported between Synapse and Azure Cosmos DB](./concept-synapse-link-cosmos-db-support.md)
165
-
*[Connect to Synapse Link for Cosmos DB](../quickstart-connect-synapse-link-cosmos-db.md)
176
+
*[Connect to Synapse Link for Cosmos DB](../quickstart-connect-synapse-link-cosmos-db.md)
0 commit comments