Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e443aa3
added MakeList and MakeSet aggregators
ezrahaleva-msft May 14, 2024
db1872a
Added MakeList and MakeSet to AggregateQueryTests.cs
ezrahaleva-msft May 24, 2024
b84e8e2
Adjust Aggregators
ezrahaleva-msft Jun 3, 2024
f42c7ec
Add Array Aggregate Continuation Token Test
ezrahaleva-msft Jun 3, 2024
2cb739c
Added group by coverage for MakeList and MakeSet
ezrahaleva-msft Jun 3, 2024
7c863d4
address comments
ezrahaleva-msft Jun 4, 2024
ff6637c
cleaning
ezrahaleva-msft Jun 4, 2024
a2c6d44
Refactored test to better detect when to ignore result order
ezrahaleva-msft Jun 5, 2024
1c82431
cleaning
ezrahaleva-msft Jun 6, 2024
8353971
cleaning, update baseline
ezrahaleva-msft Jun 6, 2024
2758e0b
cleaning
ezrahaleva-msft Jun 6, 2024
61059ac
removed old comment
ezrahaleva-msft Jun 6, 2024
57f6311
cleaning/refactoring
ezrahaleva-msft Jun 10, 2024
2c1c051
Merge branch 'master' into users/ezrahaleva/MakeListDistribution
ezrahaleva-msft Jun 11, 2024
51f5d12
cleaning
ezrahaleva-msft Jun 11, 2024
5fcb089
Add explicit cases to hit continuation token limit.
ezrahaleva-msft Jun 14, 2024
6522334
Added additional case to GroupBy tests
ezrahaleva-msft Jun 14, 2024
0defd1a
cleaning
ezrahaleva-msft Jun 14, 2024
eec3632
cleaning
ezrahaleva-msft Jun 17, 2024
918c35e
cleaning, updated baseline test
ezrahaleva-msft Jun 18, 2024
4dc9f9d
cleaning, updated baseline test
ezrahaleva-msft Jun 18, 2024
f05d33f
Added coverage to QueryPlanBaselineTests.cs
ezrahaleva-msft Jun 19, 2024
710fc76
refactored
ezrahaleva-msft Jun 20, 2024
be853ce
Merge branch 'master' into users/ezrahaleva/MakeListDistribution
ezrahaleva-msft Jun 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleaning
  • Loading branch information
ezrahaleva-msft committed Jun 17, 2024
commit eec3632bf0cad51a5809e34b47641316872f7ad3
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ internal sealed class MakeListAggregator : IAggregator
private MakeListAggregator(CosmosArray initialList)
{
this.globalList = new List<CosmosElement>();
foreach (CosmosElement listItem in initialList)

// InitialList should never be null, but if it is we just keep global list as an empty list.
if (initialList == null)
{
this.globalList.Add(listItem);
return;
}

this.globalList.AddRange(initialList.ToList<CosmosElement>());
}

public void Aggregate(CosmosElement localList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ internal sealed class MakeSetAggregator : IAggregator
private MakeSetAggregator(CosmosArray initialSet)
{
this.globalSet = new HashSet<CosmosElement>();
foreach (CosmosElement setItem in initialSet)

// InitialSet should never be null, but if it is we just keep globalSet as an empty set.
if (initialSet == null)
{
this.globalSet.Add(setItem);
return;
}

this.globalSet.UnionWith(initialSet.ToList<CosmosElement>());
}

public void Aggregate(CosmosElement localSet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1115,12 +1115,13 @@ public async Task TestArrayAggregatesWithContinuationTokenAsync()
await this.TestArrayAggregatesWithContinuationToken(100);

// using 2048 + 1 documents here to ensure list size hits continuation token limit of 16KB
// We aggregates c.age (integers) which has 8 bytes, 16KB / 8B = 2048
// We aggregate c.age (integers) which has 8 bytes, 16KB / 8B = 2048
await this.TestArrayAggregatesWithContinuationToken(2049);
}

private async Task TestArrayAggregatesWithContinuationToken(int numDocuments)
{
int seed = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
int seed = 135749376;

Random rand = new Random(seed);
List<Person> people = new List<Person>();
Expand Down