Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

SqlQuerySpec fails for Order By with Offset Query #331

Closed jyotsnaravikumar closed 4 years ago

jyotsnaravikumar commented 4 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior.

com.microsoft.azure spring-data-cosmosdb 2.2.2

String queryText = String.format( "select m.id, m.partitionKey, m.actorId, m.type , m.name, m.birthYear, "

{ "timestamp": 1588049672505, "path": "/api/actors", "status": 500, "error": "Internal Server Error", "message": "Gateway Failed to Retrieve Query Plan: Message: {\"errors\":[{\"severity\":\"Error\",\"location\":{\"start\":176,\"end\":181},\"code\":\"SC1001\",\"message\":\"Syntax error, incorrect syntax near 'order'.\"}]}\r\nActivityId: 885297e3-777d-4fdc-bacc-0b06c8ef2474, Microsoft.Azure.Documents.Common/2.10.0, Microsoft.Azure.Documents.Common/2.10.0, StatusCode: BadRequest", "requestId": "4102b2ac" }

Expected behavior Order By should have been honored in parameterized query as in String query

Actual behavior Provide a description of the actual behavior observed.

Environment summary SDK Version: Provided above Java JDK version: 8 OS Version (e.g. Windows, Linux, MacOSX) MacOS

Additional context Individually as a Order By query or as a Offset query works. Combination of Offset and Order By fails.

kushagraThapar commented 4 years ago

@jyotsnaravikumar Thanks for creating this issue, though spring data cosmosdb uses v3 SDK under the hood, whereas this place is for v2 SDK issues. Can you please close this issue here and create here instead : https://github.com/Azure/azure-sdk-for-java/issues ? That way, we will be able to track it and fix it for both v3 and v4 SDKs.

jyotsnaravikumar commented 4 years ago

@kushagraThapar : Done - https://github.com/Azure/azure-sdk-for-java/issues/10578