Skip to content
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

Cosmos: Support aggregate operators #16146

Open
smitpatel opened this issue Jun 19, 2019 · 4 comments
Assignees
Milestone

Comments

@smitpatel
Copy link
Contributor

@smitpatel smitpatel commented Jun 19, 2019

Average/Sum/Min/Max/Count

 typeof(Microsoft.Azure.Cosmos.QueryPlanHandler+QueryPlanHandlerException): Query contains 1 or more unsupported features. Upgrade your SDK to a version that does support the requested features:
    Query contained CompositeAggregate, which the calling client does not support. (Query contained CompositeAggregate, which the calling client does not support.)
    ---- Microsoft.Azure.Cosmos.QueryPlanHandler+QueryPlanHandlerException : Query contains 1 or more unsupported features. Upgrade your SDK to a version that does support the requested features:
    Query contained CompositeAggregate, which the calling client does not support. (Query contained CompositeAggregate, which the calling client does not support.)
    -------- System.ArgumentException : Query contained CompositeAggregate, which the calling client does not support.
@smitpatel smitpatel referenced this issue Jun 19, 2019
42 of 82 tasks complete
@divega divega modified the milestones: 3.0.0, Backlog Jun 20, 2019
@divega divega changed the title Cosmos: Aggregate operators Cosmos: Support aggregate operators Jun 20, 2019
@smitpatel

This comment has been minimized.

@JonPSmith

This comment has been minimized.

Copy link

@JonPSmith JonPSmith commented Oct 17, 2019

I'm trying to use Cosmos DB and I need a count of all the entries to make paging work. Can you suggest a way around this problem that doesn't require me to ingest all the data?

@AndriySvyryd

This comment has been minimized.

Copy link
Member

@AndriySvyryd AndriySvyryd commented Oct 17, 2019

@JonPSmith The best you can do for now is something like
query.Select(_ => 1).AsEnumerable().Count()

@JonPSmith

This comment has been minimized.

Copy link

@JonPSmith JonPSmith commented Oct 26, 2019

I'm sure you know but here is performance figures of the current way of using Count in EF Core (NoSQL database on Azure Cosmos DB Emulator, total number of entries = 50600, each count run three time to reduce first access setup time.

if using noSqlDbContext.Books.Select(_ => 1).AsEnumerable().Count() via EF Core

  1. Not timed.
  2. NoSQL count, EF Core select took 1,152.58 ms.
  3. NoSQL count, EF Core select took 1,201.86 ms.

If using SELECT VALUE Count(c) FROM c via cosmosClient

  1. Not timed.
  2. NoSQL count, via client took 121.09 ms.
  3. NoSQL count, via client took 100.90 ms.

If I'm doing something wrong then please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.