-
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
Queryable methods translation progress #15711
Comments
@roji @smitpatel Should this be updated for set operations? |
Bugs fixed - Allow ToList on collection projection to be called with less derived type - Project out necessary identifiers for collection join when pushing down. (Except distinct case) - Lift ordering from inner collection to generated ordered result (This would be improved further by #16226) - Map Cast from Enumerable to Queryable - Translate AsQueryable as no-op Resolves #12098 Resolves #15043 Resolves #15611 Part of #15711
Bugs fixed - Allow ToList on collection projection to be called with less derived type - Project out necessary identifiers for collection join when pushing down. (Except distinct case) - Lift ordering from inner collection to generated ordered result (This would be improved further by #16226) - Map Cast from Enumerable to Queryable - Translate AsQueryable as no-op Resolves #12098 Resolves #15043 Resolves #15611 Part of #15711
Bugs fixed - Allow ToList on collection projection to be called with less derived type - Project out necessary identifiers for collection join when pushing down. (Except distinct case) - Lift ordering from inner collection to generated ordered result (This would be improved further by #16226) - Map Cast from Enumerable to Queryable - Translate AsQueryable as no-op Resolves #12098 Resolves #15043 Resolves #15611 Part of #15711
It's not included in the list above, but it seems |
@Jehoel as the preview6 announcement explained, InMemory is temporary not working as we're working to get the entire query pipeline working well. |
Have checked off the set operations - we've probably done what we intend to support for 3.0, |
Moved this Epic to 3.0, submitting PR to wrap up work here. |
SelectMany in linq look something like following (second clause is considered the collection selector) ```C# from c in cs from o in c.Orders select.... ``` Following are the translations of SelectMany Unrelated collection selector ```C# from c in cs from o in os ``` Generates CROSS JOIN Correlated collection selector with correlation being a predicate ```C# from c in cs from o in os.Where(o => o.CustomerID == c.CustomerID) ``` Such predicate can be lifted and used in generating a join. So this query generates JOIN. If collection selector ends with DefaultIfEmpty then it is LEFT JOIN. Correlated collection selector with correlation not a predicate ```C# from c in cs from o in os.Select(o => c.City) ``` Since we cannot generate a join predicate here, this translates to CROSS APPLY. If collection selector ends with DefaultIfEmpty then it is OUTER APPLY. Add support for Cross Apply Add Support for Outer Apply Convert Cross Apply to Inner Join when possible Convert Outer Apply to Left Join when possible Add translation for DefaultIfEmpty Add translation for both overloads of SelectMany Handle DefaultIfEmpty & SelectMany without collectionSelector in Navigation Expansion Ensure columns are in projection when generating join predicate from a correlated subquery Currently there are no tests for Cross/Outer Apply. Our earlier Cross Apply got converted to join. N+1 evaluation tests are disabled right now, which would generate Cross Apply. We never supported Outer Apply in past. Resolves #15711 Resolves #12567 Resolves #12572 Resolves #12872 Resolves #16330 Resolves #15081 Resolves #16989 Re-enable tests for #12449
SelectMany in linq look something like following (second clause is considered the collection selector) ```C# from c in cs from o in c.Orders select.... ``` Following are the translations of SelectMany Unrelated collection selector ```C# from c in cs from o in os ``` Generates CROSS JOIN Correlated collection selector with correlation being a predicate ```C# from c in cs from o in os.Where(o => o.CustomerID == c.CustomerID) ``` Such predicate can be lifted and used in generating a join. So this query generates JOIN. If collection selector ends with DefaultIfEmpty then it is LEFT JOIN. Correlated collection selector with correlation not a predicate ```C# from c in cs from o in os.Select(o => c.City) ``` Since we cannot generate a join predicate here, this translates to CROSS APPLY. If collection selector ends with DefaultIfEmpty then it is OUTER APPLY. - Add support for Cross Apply - Add Support for Outer Apply - Convert Cross Apply to Inner Join when possible - Convert Outer Apply to Left Join when possible - Add translation for DefaultIfEmpty - Add translation for both overloads of SelectMany - Handle DefaultIfEmpty & SelectMany without collectionSelector in Navigation Expansion - Ensure columns are in projection when generating join predicate from a correlated subquery Currently there are no tests for Cross/Outer Apply. Our earlier Cross Apply got converted to join. N+1 evaluation tests are disabled right now, which would generate Cross Apply. We never supported Outer Apply in past. Resolves #15711 Resolves #12567 Resolves #12572 Resolves #12872 Resolves #16330 Resolves #15081 Resolves #16989 Re-enable tests for #12449
SelectMany in linq look something like following (second clause is considered the collection selector) ```C# from c in cs from o in c.Orders select.... ``` Following are the translations of SelectMany Unrelated collection selector ```C# from c in cs from o in os ``` Generates CROSS JOIN Correlated collection selector with correlation being a predicate ```C# from c in cs from o in os.Where(o => o.CustomerID == c.CustomerID) ``` Such predicate can be lifted and used in generating a join. So this query generates JOIN. If collection selector ends with DefaultIfEmpty then it is LEFT JOIN. Correlated collection selector with correlation not a predicate ```C# from c in cs from o in os.Select(o => c.City) ``` Since we cannot generate a join predicate here, this translates to CROSS APPLY. If collection selector ends with DefaultIfEmpty then it is OUTER APPLY. - Add support for Cross Apply - Add Support for Outer Apply - Convert Cross Apply to Inner Join when possible - Convert Outer Apply to Left Join when possible - Add translation for DefaultIfEmpty - Add translation for both overloads of SelectMany - Handle DefaultIfEmpty & SelectMany without collectionSelector in Navigation Expansion - Ensure columns are in projection when generating join predicate from a correlated subquery Currently there are no tests for Cross/Outer Apply. Our earlier Cross Apply got converted to join. N+1 evaluation tests are disabled right now, which would generate Cross Apply. We never supported Outer Apply in past. Resolves #15711 Resolves #12567 Resolves #12572 Resolves #12872 Resolves #16330 Resolves #15081 Resolves #16989 Re-enable tests for #12449
SelectMany in linq look something like following (second clause is considered the collection selector) ```C# from c in cs from o in c.Orders select.... ``` Following are the translations of SelectMany Unrelated collection selector ```C# from c in cs from o in os ``` Generates CROSS JOIN Correlated collection selector with correlation being a predicate ```C# from c in cs from o in os.Where(o => o.CustomerID == c.CustomerID) ``` Such predicate can be lifted and used in generating a join. So this query generates JOIN. If collection selector ends with DefaultIfEmpty then it is LEFT JOIN. Correlated collection selector with correlation not a predicate ```C# from c in cs from o in os.Select(o => c.City) ``` Since we cannot generate a join predicate here, this translates to CROSS APPLY. If collection selector ends with DefaultIfEmpty then it is OUTER APPLY. - Add support for Cross Apply - Add Support for Outer Apply - Convert Cross Apply to Inner Join when possible - Convert Outer Apply to Left Join when possible - Add translation for DefaultIfEmpty - Add translation for both overloads of SelectMany - Handle DefaultIfEmpty & SelectMany without collectionSelector in Navigation Expansion - Ensure columns are in projection when generating join predicate from a correlated subquery Currently there are no tests for Cross/Outer Apply. Our earlier Cross Apply got converted to join. N+1 evaluation tests are disabled right now, which would generate Cross Apply. We never supported Outer Apply in past. Resolves #15711 Resolves #12567 Resolves #12572 Resolves #12872 Resolves #16330 Resolves #15081 Resolves #16989 Re-enable tests for #12449
Relational:
- [ ] ElementAt (Query: Translate ElementAt(OrDefault) #17066)- [ ] ElementAtOrDefault (Query: Translate ElementAt(OrDefault) #17066)- [ ] GroupJoin (Query with GroupBy or GroupJoin throws exception #17068)- [ ] SkipWhile (Query: SkipLast and TakeLast #17065)- [ ] TakeWhile (Query: SkipLast and TakeLast #17065)InMemory:
- [ ] Cast (Query work for in-memory provider #16963)- [ ] DefaultIfEmpty (Query work for in-memory provider #16963)- [ ] ElementAt (Query: Translate ElementAt(OrDefault) #17066)- [ ] ElementAtOrDefault (Query: Translate ElementAt(OrDefault) #17066)- [ ] GroupBy (Query work for in-memory provider #16963)- [ ] GroupJoin (Query with GroupBy or GroupJoin throws exception #17068)- [ ] OfType (Query work for in-memory provider #16963)- [ ] Reverse (Query work for in-memory provider #16963)- [ ] SelectMany (Query work for in-memory provider #16963)- [ ] SkipWhile (Query: SkipLast and TakeLast #17065)- [ ] TakeWhile (Query: SkipLast and TakeLast #17065)Cosmos:
Unknowns:
- [ ] Aggregate (Not Needed)- [ ] SequenceEqual (Not Needed)- [ ] Zip (Not Needed)- [ ] SkipLast (Query: SkipLast and TakeLast #17065)- [ ] TakeLast (Query: SkipLast and TakeLast #17065)The text was updated successfully, but these errors were encountered: