Skip to content

Commit b840308

Browse files
Update custom-partitioning-analytical-store.md
Fixing code block syntax
1 parent 1f21cce commit b840308

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

articles/cosmos-db/custom-partitioning-analytical-store.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -78,44 +78,45 @@ Similarly, if you configured [customer-managed keys on analytical store](how-to-
7878
You could use one or more partition keys for your analytical data. If you are using multiple partiton keys, below are some recommendations on how to partition the data:
7979
- **Using composite keys:**
8080

81-
Say, you want to frequently query based on Key1 and Key2.
81+
Say, you want to frequently query based on Key1 and Key2.
8282

83-
For example, "Query for all records where ReadDate = ‘2021-10-08’ and Location = ‘Sydney’".
83+
For example, "Query for all records where ReadDate = ‘2021-10-08’ and Location = ‘Sydney’".
8484

85-
In this case, using composite keys will be more efficient, to look up all records that match the ReadDate and the records that match Location within that ReadDate.
85+
In this case, using composite keys will be more efficient, to look up all records that match the ReadDate and the records that match Location within that ReadDate.
8686

87-
Sample configuration options:
87+
Sample configuration options:
88+
```python
89+
.option("spark.cosmos.asns.partition.keys", "ReadDate String, Location String") \
90+
.option("spark.cosmos.asns.basePath", "/mnt/CosmosDBPartitionedStore/") \
91+
```
8892

89-
spark.cosmos.asns.basePath ”/mnt/CosmosDBPartitionedStore/”
90-
spark.cosmos.asns.partition.keys ”ReadDate String, Location String”
91-
92-
Now, on above partitioned store, if you want to only query based on "Location" filter:
93-
* You may want to query analytical store directly. Partitoned store will scan all records by ReadDate first and then by Location.
94-
So, depending on your workload and cardinatlity of your analytical data, you may get better results by querying analytical store directly.
95-
* You could also run another partition job to also partition based on ‘Location’ on the same partitioned store.
93+
Now, on above partitioned store, if you want to only query based on "Location" filter:
94+
* You may want to query analytical store directly. Partitoned store will scan all records by ReadDate first and then by Location.
95+
So, depending on your workload and cardinatlity of your analytical data, you may get better results by querying analytical store directly.
96+
* You could also run another partition job to also partition based on ‘Location’ on the same partitioned store.
9697

9798
* **Using multiple keys separately:**
9899

99100
Say, you want to frequently query sometimes based on 'ReadDate' and other times, based on 'Location'.
100-
101+
101102
For example,
102103
- Query for all records where ReadDate = ‘2021-10-08
103104
- Query for all records where Location = ‘Sydney’
104105

105106
Run two partition jobs with partition keys as defined below for this scenario:
106107

107108
Job 1:
108-
109-
spark.cosmos.asns.basePath ”/mnt/CosmosDBPartitionedStore/”
110-
spark.cosmos.asns.partition.keys ”ReadDate String”
111-
109+
```python
110+
.option("spark.cosmos.asns.partition.keys", "ReadDate String") \
111+
.option("spark.cosmos.asns.basePath", "/mnt/CosmosDBPartitionedStore/") \
112+
```
112113
Job 2:
113-
114-
spark.cosmos.asns.basePath ”/mnt/CosmosDBPartitionedStore/”
115-
spark.cosmos.asns.partition.keys ”Location String”
116-
117-
Please note that it's not efficient to now frequently query based on "ReadDate" and "Location" filters together, on above partitioning. Composite keys will give
118-
better query performance in that case.
114+
```python
115+
.option("spark.cosmos.asns.partition.keys", "Location String") \
116+
.option("spark.cosmos.asns.basePath", "/mnt/CosmosDBPartitionedStore/") \
117+
```
118+
Please note that it's not efficient to now frequently query based on "ReadDate" and "Location" filters together, on above partitioning. Composite keys will give
119+
better query performance in that case.
119120

120121
## Limitations
121122

@@ -158,10 +159,10 @@ Yes, the partition key for the given container can be changed and the new partit
158159

159160
Yes, you can specify multiple partition keys on the same partitioned store as below:
160161

161-
162-
spark.cosmos.asns.basePath ”/mnt/CosmosDBPartitionedStore/”
163-
spark.cosmos.asns.partition.keys ”ReadDate String, Location String”
164-
162+
```python
163+
.option("spark.cosmos.asns.partition.keys", "ReadDate String, Location String") \
164+
.option("spark.cosmos.asns.basePath", "/mnt/CosmosDBPartitionedStore/") \
165+
```
165166

166167
## Next steps
167168

0 commit comments

Comments
 (0)