Skip to content

Commit

Permalink
Max Item Count Fix (#867)
Browse files Browse the repository at this point in the history
* reproed scenario

* fixed scenario

* fixed test
  • Loading branch information
bchong95 authored and Jake Willey committed Oct 9, 2019
1 parent 6041009 commit 6d8cbc9
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,17 @@ public static async Task<CosmosQueryExecutionContext> CreateAsync(

QueryInfo queryInfo = initParams.PartitionedQueryExecutionInfo.QueryInfo;

int actualPageSize = initParams.InitialPageSize;
int initialPageSize = initParams.InitialPageSize;
CosmosCrossPartitionQueryExecutionContext.CrossPartitionInitParams parameters = initParams;
if (queryInfo.HasGroupBy)
{
initialPageSize = int.MaxValue;
// The query will block until all groupings are gathered so we might as well speed up the process.
initParams = new CosmosCrossPartitionQueryExecutionContext.CrossPartitionInitParams(
sqlQuerySpec: initParams.SqlQuerySpec,
collectionRid: initParams.CollectionRid,
partitionedQueryExecutionInfo: initParams.PartitionedQueryExecutionInfo,
partitionKeyRanges: initParams.PartitionKeyRanges,
initialPageSize: initialPageSize,
initialPageSize: int.MaxValue,
maxConcurrency: initParams.MaxConcurrency,
maxItemCount: int.MaxValue,
maxBufferedItemCount: initParams.MaxBufferedItemCount);
Expand Down
Loading

0 comments on commit 6d8cbc9

Please sign in to comment.