Closed jyotsnaravikumar closed 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.
@kushagraThapar : Done - https://github.com/Azure/azure-sdk-for-java/issues/10578
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior.
String queryText = String.format( "select m.id, m.partitionKey, m.actorId, m.type , m.name, m.birthYear, "
"order by m.textSearch, m.actorId "); querySpec.queryText(queryText);
SqlParameterList parameterList = new SqlParameterList(); parameterList.add(new SqlParameter("@type", actorDocumentType)); parameterList.add(new SqlParameter("@offset", 0)); parameterList.add(new SqlParameter("@limit", 100)); querySpec.parameters(parameterList);
{ "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.