Skip to content

Commit 596209e

Browse files
authored
Update stream-analytics-documentdb-output.md
Complete paragraph "Cosmos DB settings for JSON output" to include the requirement of including the partition key in the output record (case sensitive), and potentially use PARTITION BY as well.
1 parent a678f00 commit 596209e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

articles/stream-analytics/stream-analytics-documentdb-output.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ Creating Cosmos DB as an output in Stream Analytics generates a prompt for infor
9393
|Container name | The container name to be used. `MyContainer` is a sample valid input - one container named `MyContainer` must exist. |
9494
|Document ID | Optional. The column name in output events used as the unique key on which insert or update operations must be based. If left empty, all events will be inserted, with no update option.|
9595

96+
Once the Cosmos DB output is configured, it can be used in the query as the target of an [INTO statement](https://docs.microsoft.com/en-us/stream-analytics-query/into-azure-stream-analytics). When using a Cosmos DB output as such, [a partition key needs to be set explicitly](https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-parallelization#partitions-in-sources-and-sinks). The output record must contain a column named (case-sensitive) after the partition key in Cosmos DB. To achieve greater parallelization, the statement may require a [PARTITION BY clause](https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-parallelization#embarrassingly-parallel-jobs) using the same column.
97+
98+
**Sample query**:
99+
100+
```SQL
101+
SELECT TollBoothId, PartitionId
102+
INTO CosmosDBOutput
103+
FROM Input1 PARTITION BY PartitionId
104+
```
105+
96106
## Error Handling and retries
97107

98108
In the event of a transient failure, service unavailability or throttling while sending events to Cosmos DB, Stream Analytics retries indefinitely to successfully complete the operation. However, there are some failures for which retries are not attempted and they are as follows:

0 commit comments

Comments
 (0)