-
-
Notifications
You must be signed in to change notification settings - Fork 44
Using Raw SQL with inner query with where condition #106
Comments
You can see my change here: tidusjar@c911f45 This fixes my issue, but It doesn't seem right. |
Wait a second. I'm pretty sure you cannot have nested select queries in a Cosmos DB SQL query. |
Nested select queries does seem to work fine on the Azure Portal and returns the expected output. And it also works fine with Cosmonaut with the exception of this current issue |
This seems to be a new feature. It wasn’t working some months ago and it isn’t documented anywhere. I will probably have to address this. |
Yeah your fix wouldn't work in any other scenario. The fix will have to detect all the queries and inject the appropriate strings with recursion. |
Not sure if this helps: https://stackoverflow.com/questions/51042600/cosmosdb-subdocument-delselecting-linq-query/51121262#51121262 He is from Cosmos DB Engineering team |
Ok so I started looking into this. Can you give me a few example nested select queries without the CosmosEntityName where clause and how you want them to be after the sql parsing? |
So all the issue really is, is in the nested query we have a Another example
where the user defined function is:
The reason why I am doing things like this is because our internal library (Primary written for MSSQL) is able to apply advanced concepts e.g. multiple column filtering/sorting and be able to generate the SQL for it. So I am using a slightly tweaked version of that internal lib to be able to work with Cosmos DB. |
Here is another example (More complex): Original Query:
Expected Output:
|
When using Raw Sql with the following query:
This will be executed as
We seem to lose the other
where
clause and also theorder by
.This seems to be down to how we are splitting up the query to inject the
CosmosEntityName
condition.The text was updated successfully, but these errors were encountered: