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
+17-9Lines changed: 17 additions & 9 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,13 +11,13 @@ 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
-
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.
16
+
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.
17
17
18
18
## Load to DataFrame
19
19
20
-
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 into dataframe, you can perform additional analysis. This operation does not impact the transactional store.
20
+
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.
21
21
22
22
```python
23
23
# To select a preferred list of regions in a multi-region Cosmos DB account, add .option("spark.cosmos.preferredRegions", "<Region1>,<Region2>")
@@ -42,7 +42,7 @@ val df_olap = spark.read.format("cosmos.olap").
42
42
43
43
## Create Spark table
44
44
45
-
In this gesture, you will create a Spark table pointing to the container you selected. That operation does not incur any data movement. If you decide to delete that 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 for the run-time.
45
+
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 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.
58
+
59
+
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.
59
60
60
61
```python
61
62
# Write a Spark DataFrame into a Cosmos DB container
@@ -85,7 +86,8 @@ df.write.format("cosmos.oltp").
85
86
```
86
87
87
88
## Load streaming DataFrame from container
88
-
In this gesture, you will use Spark Streaming capability to load data from a container into a dataframe. The data will be stored into the primary data lake account (and file system) that you connected to the workspace. If the folder /localReadCheckpointFolder is not created, it will be automatically created. This operation will impact the transactional performance of Cosmos DB.
89
+
90
+
In this gesture, you will use Spark Streaming capability to load data from a container into a dataframe. The data will be stored into the primary data lake account (and file system) that you connected to the workspace. If the folder /localReadCheckpointFolder does not exist, it will be automatically created. This operation will impact the transactional performance of Cosmos DB.
89
91
90
92
```python
91
93
# To select a preferred list of regions in a multi-region Cosmos DB account, add .option("spark.cosmos.preferredRegions", "<Region1>,<Region2>")
@@ -117,7 +119,8 @@ val dfStream = spark.readStream.
117
119
```
118
120
119
121
## Write streaming DataFrame to container
120
-
In this gesture, you will write a streaming dataframe into the Cosmos DB container you selected. If the folder /localReadCheckpointFolder is not created, it will be automatically created. This operation will impact the transactional performance of Cosmos DB.
122
+
123
+
In this gesture, you will write a streaming dataframe into the Cosmos DB container you selected. If the folder /localReadCheckpointFolder does not exist, it will be automatically created. This operation will impact the transactional performance of Cosmos DB.
121
124
122
125
```python
123
126
# To select a preferred list of regions in a multi-region Cosmos DB account, add .option("spark.cosmos.preferredRegions", "<Region1>,<Region2>")
0 commit comments