Feature Summary
Add production, resumable cross-partition streaming ORDER BY execution to the Cosmos DB Rust driver.
Feature Description
Implement a production StreamingOrderedMerge stage over Gateway rewritten result envelopes.
Validation and acceptance criteria:
- Consume rewritten envelopes containing ORDER BY values and return only the public payload.
- Compare multiple ORDER BY columns with independent ascending/descending directions using Cosmos JSON comparison semantics.
- Resolve equal sort keys deterministically using RID and partition-range tie-breakers.
- Replenish the merge heap correctly as each partition page is consumed.
- Honor requested output page sizing without losing buffered items.
- Persist durable per-range and intra-page continuation state.
- Repair continuation state after partition splits without duplication or omission.
- Cover null, undefined, mixed JSON types, duplicate keys, empty pages, TOP composition, resume, and partition splits.
Use Case
Applications need globally ordered cross-partition results that can be paged, resumed, and repaired after physical partition changes without sacrificing deterministic Cosmos ordering.
Alternatives
Collecting and sorting all results is not suitable for large resumable queries and cannot provide the required split-safe continuation behavior.
Additional Context
Implement under sdk/cosmos/azure_data_cosmos_driver/src/driver/dataflow/. This depends on the parent issue's pipeline factory, rewritten-query application, internal envelopes, response transformation, continuation policy, and reusable dataflow tests. Cross-SDK references: .NET Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs, OrderByContinuationToken.cs, and Microsoft.Azure.Cosmos.EmulatorTests/Query/OrderByQueryTests.cs; Java sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/OrderByDocumentQueryExecutionContext.java, OrderByContinuationToken.java, and orderbyquery/.
Feature Summary
Add production, resumable cross-partition streaming ORDER BY execution to the Cosmos DB Rust driver.
Feature Description
Implement a production
StreamingOrderedMergestage over Gateway rewritten result envelopes.Validation and acceptance criteria:
Use Case
Applications need globally ordered cross-partition results that can be paged, resumed, and repaired after physical partition changes without sacrificing deterministic Cosmos ordering.
Alternatives
Collecting and sorting all results is not suitable for large resumable queries and cannot provide the required split-safe continuation behavior.
Additional Context
Implement under
sdk/cosmos/azure_data_cosmos_driver/src/driver/dataflow/. This depends on the parent issue's pipeline factory, rewritten-query application, internal envelopes, response transformation, continuation policy, and reusable dataflow tests. Cross-SDK references: .NETMicrosoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs,OrderByContinuationToken.cs, andMicrosoft.Azure.Cosmos.EmulatorTests/Query/OrderByQueryTests.cs; Javasdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/OrderByDocumentQueryExecutionContext.java,OrderByContinuationToken.java, andorderbyquery/.