-
Notifications
You must be signed in to change notification settings - Fork 488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query: Adds translation support for single key single value select GROUP BY LINQ queries #4074
Query: Adds translation support for single key single value select GROUP BY LINQ queries #4074
Conversation
add code for group by substitution. Still need to adjust binding post groupby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good!
…alue selector followed by an optional select clause
...oft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqGeneralBaselineTests.cs
Outdated
Show resolved
Hide resolved
...oft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqGeneralBaselineTests.cs
Outdated
Show resolved
Hide resolved
....EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestGroupByTranslation.xml
Outdated
Show resolved
Hide resolved
....EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestGroupByTranslation.xml
Outdated
Show resolved
Hide resolved
....EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestGroupByTranslation.xml
Outdated
Show resolved
Hide resolved
....EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestGroupByTranslation.xml
Outdated
Show resolved
Hide resolved
....EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestGroupByTranslation.xml
Outdated
Show resolved
Hide resolved
....EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestGroupByTranslation.xml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
....EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestGroupByTranslation.xml
Outdated
Show resolved
Hide resolved
....EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestGroupByTranslation.xml
Outdated
Show resolved
Hide resolved
....EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestGroupByTranslation.xml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New here; I'm just confused, got a question: Is this live on nuget package Getting error on 8.0.3: Unhandled exception rendering component: The LINQ expression 'DbSet<PropertyView>()
.GroupBy(
keySelector: p => p.PropertyId,
resultSelector: (key, g) => new PropertyWithReadCountDTO{
PropertyId = key,
PropertyTotalViews = g
.AsQueryable()
.Count(e => (int)e.EventType == 1),
PropertyTotalClicks = g
.AsQueryable()
.Count(e => (int)e.EventType == 0)
}
)' could not be translated... The code: List<PropertyWithReadCountDTO> result = await query.GroupBy(
x => x.PropertyId,
(key, values) => new PropertyWithReadCountDTO
{
PropertyId = key,
PropertyTotalViews = values.Count(v => v.EventType == EventType.View),
PropertyTotalClicks = values.Count(v => v.EventType == EventType.Click)
}).ToListAsync(cancellationToken).ConfigureAwait(false); |
Pull Request Template
Description
This is the first of a set of PRs to add incremental support for Group By for LINQ queries. Specifically, this PR adds support for Group By queries grouping by a single key, and projecting a single value.
While LINQ has multiple function signatures for GroupBy queries, we will only currently support the current signature:
GroupBy<TSource,TKey,TResult>(IEnumerable, Func<TSource,TKey>, Func<TKey,IEnumerable,TResult>)
Example of use:
Limitations:
These limitations are temporary and will change as more GROUP BY functionality will be supported.
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #IssueNumber