-
Notifications
You must be signed in to change notification settings - Fork 246
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
Using aggregate functions in query doesn't seem to work. #946
Comments
We can certainly do a better job showing nice error messages, but I'll address the direct issue. You are likely getting a 400 due to trying to query across continuations. I believe this is due to the use of "max" in your query. I'm not familiar enough with Cosmos DBs querying engine to know what the work around is here. I could not find out how other SDKs are currently handling this, but perhaps @heaths has some insight. |
By design, we try to avoid extra client-side validation and, by extension, assumption of error causes unless obvious. Thus, we pass the service errors straight through. Perhaps improving the error e.g., making it actionable, is best done by the service themselves. |
@heaths interestingly the error message says that this should be handled by the client:
Do you know what that refers to? |
I didn't see that in the error above, but it is in the page linked (which shouldn't refer to the "en-us" locale, but that's an entirely different issue). I don't know anything about the Cosmos service. Adding codeowners from the Azure SDK for .NET repo: @pjohari-ms @MehaKaushik @shurd @anfeldma-ms @zfoster @kushagraThapar Can anyone shed some light on what this error means and if/how we should better represent it? Ideally, behavior here should match what we do in other languages for Azure SDK but I have no insight into the Cosmos DB SDK. |
So I was trying to do this yesterday:
The request failed and the logs only showed
But the query worked fine in Azure portal when I created a new SQL query against the container. I tried searching in the docs, but I couldn't seem to find other functions that accept queries. Digging in Microsoft docs, I also found this here:
But the logs showed that the endpoint being requested was
https://<my-db-account>.documents.azure.com/dbs/<my-db-name>/colls/Users/docs
, which doesn't seem to be the right endpoint?It led me to think if the 400 Bad Request was caused by this:
Is it a bug, or the library currently doesn't support using aggregate functions in queries, or I'm calling an incorrect function?
The text was updated successfully, but these errors were encountered: