-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: GroupBy Where Aggregate translation to server #11711
Comments
Hello @smitpatel
(maybe more?) Please support them all in the context of this feature. |
@AlekseyMartynov - Thanks for information. All of them are normalized into single form in our query parser so shouldn't be issue in supporting them all. |
Hi guys. What about the case with Ranking? Let's say I have a table with clients. And I need to group them by Country and select the top1 earning client in each country. So result should be: I use This query will be evaluated locally. Do you have any advises to execute it on server? EF 6.2 can do it. |
It's interesting to note that you can run into this issue just by using a navigation property in the Example: await this.dbContext.Games
.Select(g =>
g.RoundScores
.GroupBy(rs => rs.Player)
.Select(o => o.Key)
.Count()
)
.ToListAsync();
|
@mthalman - That is incorrect assumption. GroupBy entityType is being tracked at #17653 You can look up into that issue discussion why GroupBy entity type is not straight fwd SQL GROUP BY. This issue tracks about using Where on IGrouping parameter which is generated after applying GroupBy before applying aggregate operator. |
Currently if there is predicate after grouping and before applying Aggregate operation we block the translation to server and do streaming GroupBy. Aggregate operator argument can take Case Block to do conditional aggregate and allow us to generate Group By clause in SQL.
Structure would be
The text was updated successfully, but these errors were encountered: