Alternative to the group for db space

Considering that cosmos db does not support group by, which is a good alternative to achieve similar functionality:

Select sum(*) , groupterm from tble group by groupterm

      

Can I efficiently achieve this in a space stored procedure?

+7


source to share


2 answers


As Cosmos_DB says this:

SQL aggregation capabilities are limited to COUNT, SUM, MIN, MAX, AVG functions. There is no support for GROUP BY or other aggregation functions found on database systems. However, stored procedures can be used to implement aggregation capabilities in a database.

Can I efficiently achieve this in a space stored procedure?



For .NET and Node.js

Larry McCherone provided an excellent package documentdb-lumenize that supports aggregations (Group-by, Pivot-table, and N-cube) and time series transformations as stored procedures in DocumentDB.

Also, for Python and Scala, you can refer to azure-cosmosdb-spark .

+11


source


Grouping by is now supported in the Cosmos db SQL API. You need SDK version 3.3 or higher

Azure Cosmos DB currently supports GROUP BY in the .NET SDK 3.3 or later. Support for other languages ​​in the SDK and Azure Portal is not currently supported. available but planned.



https://docs.microsoft.com/en-gb/azure/cosmos-db/sql-query-group-by

0


source







All Articles