-
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: Include Collection group by reference throws exception #10974
Comments
|
problem is that we add orderby group key clause to the query. When we compile include we project order by clauses in the inner query (one being qsre). We should optimize group by entity, to group by entity key instead. |
assigning to @smitpatel since he is working on entity equality improvement currently |
Hold on! |
Ah right, I guess we can just recognize we are about to order by qsre and order by key instead. |
Further entity equality deals with equality only and wouldn't process just a qsre in ordering. Perhaps include pipeline at some place needs to convert QSRE to key access while constructing collection query model since AnonymousObject cannot hold a qsre. |
or we could do that broadly, in OptimizeQueryModel - we just need to convert orderby qsre into orderby pk before RewriteCollectionQueries |
We can certainly do that more broadly. Right now we have piece of code in SqlTranslatingExpressionVisitor which translates QSRE to PK access when not in projection. Perhaps we could evaluate that code path and convert those to PK access during QM rewrite itself. |
#11022 - GroupJoin with an entity object as a key fails #10974 - Query: Include Collection group by reference throws exception #11245 - Query: compilation error for queries with join where the inner key is navigation - Added step to the QueryOptimizer that converts entity qsre comparison to key comparisons instead for order by join and group join, - Improved logic of join/groupjoin inner key navigation rewrite to correctly handle case when navigation is the final operator (i.e. no scalar is projected at the end), - Improved "requires materialization" logic to correctly mark qsre projected out of subquery that is a result of nav rewrite of join/groupjoin inner key.
#11288 - Query: Join/GroupJoin where key selectors are qsres or navigations fails during compilation #10974 - Query: Include Collection group by reference throws exception #11245 - Query: compilation error for queries with join where the inner key is navigation - Added step to the QueryOptimizer that converts entity qsre comparison to key comparisons instead for order by join and group join, - Improved logic of join/groupjoin inner key navigation rewrite to correctly handle case when navigation is the final operator (i.e. no scalar is projected at the end), - Improved "requires materialization" logic to correctly mark qsre projected out of subquery that is a result of nav rewrite of join/groupjoin inner key.
#11288 - Query: Join/GroupJoin where key selectors are qsres or navigations fails during compilation #10974 - Query: Include Collection group by reference throws exception #11245 - Query: compilation error for queries with join where the inner key is navigation #9481 - EF Core joining on the wrong field when using GroupBy - Added step to the QueryOptimizer that converts entity qsre comparison to key comparisons instead for order by join and group join, - Improved logic of join/groupjoin inner key navigation rewrite to correctly handle case when navigation is the final operator (i.e. no scalar is projected at the end), - Improved "requires materialization" logic to correctly mark qsre projected out of subquery that is a result of nav rewrite of join/groupjoin inner key.
#11288 - Query: Join/GroupJoin where key selectors are qsres or navigations fails during compilation #10974 - Query: Include Collection group by reference throws exception #11245 - Query: compilation error for queries with join where the inner key is navigation #11022 - Query: GroupJoin with a complex join key fails during compilation #9481 - EF Core joining on the wrong field when using GroupBy - Added step to the QueryOptimizer that converts entity qsre comparison to key comparisons instead for order by join and group join, - Improved logic of join/groupjoin inner key navigation rewrite to correctly handle case when navigation is the final operator (i.e. no scalar is projected at the end), - Improved "requires materialization" logic to correctly mark for materialization query sources coming from subquery join keys.
#11288 - Query: Join/GroupJoin where key selectors are qsres or navigations fails during compilation #10974 - Query: Include Collection group by reference throws exception #11245 - Query: compilation error for queries with join where the inner key is navigation #11022 - Query: GroupJoin with a complex join key fails during compilation #9481 - EF Core joining on the wrong field when using GroupBy - Added step to the QueryOptimizer that converts entity qsre comparison to key comparisons instead for order by join and group join, - Improved logic of join/groupjoin inner key navigation rewrite to correctly handle case when navigation is the final operator (i.e. no scalar is projected at the end), - Improved "requires materialization" logic to correctly mark for materialization query sources coming from subquery join keys.
#11288 - Query: Join/GroupJoin where key selectors are qsres or navigations fails during compilation #10974 - Query: Include Collection group by reference throws exception #11245 - Query: compilation error for queries with join where the inner key is navigation #11022 - Query: GroupJoin with a complex join key fails during compilation #9481 - EF Core joining on the wrong field when using GroupBy - Added step to the QueryOptimizer that converts entity qsre comparison to key comparisons instead for order by join and group join, - Improved logic of join/groupjoin inner key navigation rewrite to correctly handle case when navigation is the final operator (i.e. no scalar is projected at the end), - Improved "requires materialization" logic to correctly mark for materialization query sources coming from subquery join keys.
#11288 - Query: Join/GroupJoin where key selectors are qsres or navigations fails during compilation #10974 - Query: Include Collection group by reference throws exception #11245 - Query: compilation error for queries with join where the inner key is navigation #11022 - Query: GroupJoin with a complex join key fails during compilation #9481 - EF Core joining on the wrong field when using GroupBy - Added step to the QueryOptimizer that converts entity qsre comparison to key comparisons instead for order by join and group join, - Improved logic of join/groupjoin inner key navigation rewrite to correctly handle case when navigation is the final operator (i.e. no scalar is projected at the end), - Improved "requires materialization" logic to correctly mark for materialization query sources coming from subquery join keys.
fixed in fdb8ece |
Reopening because there is still a failing test (Include_collection_group_by_reference) referencing this issue. |
|
@smitpatel to follow up. |
Duplicate of #17068 |
In GearsOfWarQueryTestBase
The text was updated successfully, but these errors were encountered: