Azure Cosmos DB Python SDK limitations

Sanjana Rajagopala 20 Reputation points Microsoft Employee
2023-05-24T00:19:18.15+00:00

Python SDK for Azure Cosmos DB SQL Api has limitations on support for GROUP BY and aggregate queries.

Posting this question to understand -

  1. If there is a plan to fix these limitations, if so, any ETA/release timeline?
  2. Meanwhile, are there any recommended workarounds specifically for the above mentioned cases
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,901 questions
0 comments No comments
{count} votes

Accepted answer
  1. Boris Von Dahle 3,221 Reputation points
    2023-05-24T06:00:13.1533333+00:00

    Hello,

    ETA is September : https://github.com/Azure/azure-sdk-for-python/issues/25868#issuecomment-1522394000

    Some years ago, workarounds were mentioned in this topic:
    https://stackoverflow.com/questions/45270125/alternative-to-group-by-for-cosmos-db

    A package called 'documentdb-lumenize' is available for .NET and Node.js, which supports Aggregations (Group-by, Pivot-table, and N-dimensional Cube) and Time Series Transformations as Stored Procedures in DocumentDB.
    The examples for calling the stored procedure are only given for Node.js and .NET but the procedure can be called from any client-side library, including Python.
    https://github.com/lmaccherone/documentdb-lumenize

    Additionally, for Python and Scala, you could refer to azure-cosmosdb-spark.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.