dotnet/efcore

Cosmos: Distinct operator in queries

smitpatel opened this issue · 4 comments

Test: Distinct
System.ArgumentException : Distict query requires a matching order by in order to return a continuation token.
If you would like to serve this query through continuation tokens, then please rewrite the query in the form 'SELECT DISTINCT VALUE c.blah FROM c ORDER BY c.blah' and please make sure that there is a range index on 'c.blah'.

To test on Cosmos.

@divega to look into order-by lifting.

Here is the original orderby lifting spec: #16226.

Basic Distinct scenarios work now. Many are blocked due to lack of subqueries, meaning we can't do pushdown (e.g. customers.Distinct().OrderBy()) or customers.Distinct().Count()