Query: Adds support for non streaming ORDER BY#4362
Query: Adds support for non streaming ORDER BY#4362microsoft-github-policy-service[bot] merged 36 commits intomasterfrom
Conversation
I'd avoid 'Static' here #Resolved Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs:71 in dd5ae23. [](commit_id = dd5ae23475604edfca950939b757aa0ea313e4dd, deletion_comment = False) |
new lines #Resolved Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs:50 in dd5ae23. [](commit_id = dd5ae23475604edfca950939b757aa0ea313e4dd, deletion_comment = False) |
parameters or something else #Resolved Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs:110 in dd5ae23. [](commit_id = dd5ae23475604edfca950939b757aa0ea313e4dd, deletion_comment = False) |
this.bufferedPages.Count > 0 #Resolved Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs:152 in dd5ae23. [](commit_id = dd5ae23475604edfca950939b757aa0ea313e4dd, deletion_comment = False) |
Consider only using the MultiLevel class #Pending Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs:2031 in 4271b86. [](commit_id = 4271b8691ad67e7eb7605b19a5ebd85efad439fc, deletion_comment = False) |
4271b86 to
d77567d
Compare
|
All the other pipeline stages also use inline constants. This code will be invoked in loop, where we may not want to pay the performance cost of doing a resource lookup. I will keep this as is for now. In reply to: 2010479803 Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs:1885 in eba9d5a. [](commit_id = eba9d5a, deletion_comment = False) |
…AsyncEnumerator and IAsyncEnumerator
…thereby removing the awkward method SetCancellationToken from IQueryPipelineStage
…for an alternative implementation for non streaming order by
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp automerge |
|
Command 'automerge' is not supported by Azure Pipelines. Supported commands
See additional documentation. |
Description
This change adds support for non streaming ORDER BY. Prior to this, the SDK assumed that the documents returned by the backend in response to ORDER BY queries were totally ordered across continuations. With the addition of non streaming ORDER BY to the backend, this is no longer true. The backend indicates this with a new field in the response body,
_streamingthat will be set tofalse. In this case, a new non streaming order by pipeline stage is created. This is a blocking pipeline stage similar to GROUP BY. This stage accumulates all backend responses before it yields any results. This stage is exercised only if_streamingis set to false in the backend response to an ORDER BY query.This change also fixes a few bugs in the SDK code:
The
ResponseLengthInBytesproperty ofQueryPagewas being set incorrectly in several pipeline stages and has been removed.The
IQueryPipelineStageinterface had an awkwardSetCancellationTokenmethod that has been removed in favor of taking theCancellationTokenas a parameter to theMoveNextAsyncmethod onITracingAsyncEnumeratorinstead.The index utilization header was not being accumulated correctly in
SkipEmptyPageQueryPipelineStage, and similar code inClientAggregateQueryPipelineStagehad an unnecessary allocation in a loop.Type of change
Closing issues
To automatically close an issue: closes #IssueNumber