Add Group By support for Aggregate Functions
We're really happy about the new aggregate functions that recently were announced. But without Group By support they fall short and will leave many disappointed. Please add Group By support as well.

Azure Cosmos DB now supports GROUP BY queries! With GROUP BY, you can run queries that group your results according to the values of one or more specified properties. This feature is currently supported in Data Explorer, JavaScript SDK 3.4, and .NET SDK 3.3. Support for other SDKs will be available later this year.
90 comments
-
Jan Fruseth commented
Running the following:
var result = queryqueryable.Where(d => orgnrs.Contains(d.Orgnr)).GroupBy(ar => ar.Timestamp.Date).Select(a => new { Date = a.Key, OutstandingAmout = a.Sum(ar => ar.Outstanding) }).ToList();Got following exeption: "Method 'GroupBy' is not supported., Windows/10.0.18362 cosmos-netstandard-sdk/3.3.0. "
Someone who actual got this work?
-
Jan Fruseth commented
Support for .Net SDK 3.3? Where can I download this?
-
Burdyugov, Anton commented
Why does group by is not working for an non-partitioned collections?
SELECT top 5 c.questionName, count(1) as count FROM c
group by c.questionName
This simple query returns 0-0 results on portal in Data Explorer. Am I doing smth wrong? -
jasaram commented
Thanks team...
-
Bryan commented
I am also unable to utilize group by across partitions. Unfortunately, without cross-partition support, group by is largely useless to us. Are there any plans to support cross-partition group by queries?
EDIT - Looks like cross-partition group by works with the SDK only right now and will eventually be included in the portal.
-
Valerio Natangelo commented
Just tried this querying from the portal:
https://docs.microsoft.com/en-gb/azure/cosmos-db/sql-query-group-by
and it fails for cross-partition queries:
Cross partition query only supports 'VALUE <AggreateFunc>' for aggregates
I have to say that after waiting one year this is very disappointing.
-
Anonymous commented
What is awaiting moderator approval??
-
Anonymous commented
It seems like it is now supported in SDK 3.3 and above
https://docs.microsoft.com/en-gb/azure/cosmos-db/sql-query-group-by -
Ryan Bowden commented
This is now done: https://docs.microsoft.com/en-gb/azure/cosmos-db/sql-query-group-by
-
Jesse White commented
Looks like this has been added:
https://docs.microsoft.com/en-gb/azure/cosmos-db/sql-query-group-byOnly available in .NET SDK 3.3
-
Anonymous commented
Seems like it is now supported
https://docs.microsoft.com/en-gb/azure/cosmos-db/sql-query-group-by
-
Stuart Hallows commented
Any update please?
-
Smit, Steven (CTN) commented
Please let us know if this is going to ship by end of October? I need some clarity on this key feature.
-
Ste Wilson commented
https://twitter.com/AzureCosmosDB/status/1166357072604274688
so we should expect this by the end of October?
Please can you update if your not going to hit this.
-
Philip Lupercio commented
We moved to Couchbase because of this, too. My applications just could not wait any longer and I have stakeholders I need to satisfy. They are also getting support for SQL windowing functions + GROUP BY as well as other very useful analytics functions... CTEs, UDFs, cross-document join, multi-document ACID transactions, etc...
Perhaps will reevaluate Cosmos DB in the years to come.
-
Anonymous commented
They say that it should be out in 6-8 weeks. Please don't move to Couchbase (yet)
https://twitter.com/AzureCosmosDB/status/1166357072604274688
-
Anonymous commented
I totally agree with Nate. It's been quite long since the status is just "coming soon". At least provide a reasonable ETA so that we can plan accordingly.
-
Nate commented
I'm sorry, but throwing in spark for the sake of a standard query capability seems a bit excessive, to put it mildly. This has been going on for nearly a year now - is it possible to get an actual ETA or update on this?
I've been a big proponent of Cosmos and have used it in a number of projects for clients, but it's getting to the point of absurdity having to say "but it can't do that" - it's like a bad Meatloaf parody. Please get some of this core stuff addressed ASAP and/or provide regular updates. A year without delivery is a little underwhelming. Still waiting on autoscale RUs that were promised, as well, btw.
-
Sagar commented
I think we are struggling big time by choosing cosmos db to store our analytical data. It does not support group by which we need so that people can customize reports and dashboards on the fly. I hope someone responds to this as soon as possible.
-
Ayman commented
Please update