-
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: Improvements to Relational GroupBy translation for composition #11222
Conversation
76df74f
to
b95111c
Compare
Ping! |
/// <value> | ||
/// The predicate. | ||
/// </value> | ||
public virtual Expression HavingExpression { get; [param: CanBeNull] set; } |
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.
Having
b95111c
to
2a1c7b1
Compare
Updated to translate group by constant/parameter. Ready for review. |
2a1c7b1
to
e8ca357
Compare
@"SELECT [o].[CustomerID] AS [Key], COUNT(*) AS [Count] | ||
FROM [Orders] AS [o] | ||
GROUP BY [o].[CustomerID] | ||
HAVING COUNT(*) > 4"); |
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.
🎉
return translatedKey; | ||
} | ||
|
||
goto default; |
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.
Can the default block be moved after the switch?
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.
Yes. Would it matter though?
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.
Code would be more standard. n-dev problem
@@ -721,11 +711,35 @@ var newMemberExpression | |||
|
|||
private Expression TryBindQuerySourcePropertyExpression(MemberExpression memberExpression) | |||
{ | |||
if (memberExpression.Expression is QuerySourceReferenceExpression qsre) | |||
if (!(memberExpression.Expression is QuerySourceReferenceExpression qsre)) |
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.
Flip condition?
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.
Flipping condition wouldn't avoid nesting. First if block retrieves the QSRE in multiple cases. Second if block uses QSRE to find the translation.
e8ca357
to
6cf774e
Compare
- Add support for translating OrderBy after GroupBy operator - Add support for `HAVING` clause in SQL which would be generated when translating predicate after GroupByAggregate Resolves #10870 - Make sure client eval warning is not issued when translating GroupByAggregate Resolves #11157 - GroupBy Aggregate works when element/result selector is DTO instead of anonymous type Resolves #11176 (KeySelector has to be client evaluated) - Make sure that SQL added to GROUP BY clause is not aliased Resolves #11218 - Translate GroupBy Constant/Parameter with aggregates Resolves #9969 Part of #10012 Part of #2341
6cf774e
to
5b6e178
Compare
Query: Improvements to Relational GroupBy translation for composition
HAVING
clause in SQL which would be generated when translating predicate after GroupByAggregate Resolves Query: GroupBy with Where produces invalid SQL #10870Part of #10012
Part of #2341