cosmosdb-server
cosmosdb-server copied to clipboard
Query triggers `Unexpected token '.'`
Looks like an internal error on the following query (went sent raw, untransformed):
SELECT
COUNT(1)
FROM (
SELECT
c.name
FROM c
WHERE
c.name = 'READY'
) AS c
Its worth noting that non-correlated sub queries are not supported in Cosmos https://docs.microsoft.com/en-us/azure/cosmos-db/sql/sql-query-subquery. These queries will return results, but if the sub query is cross partition or paginated the results will be incorrect
Good to know. To be fair, I was trying to craft a query that would expose a problem in a different library when I noticed that particular error message.
My suggestion is to catch it properly and return a semantic error for it. But if you're considering this out of scope because the query itself happens to be garbage then by all means just close the issue :)