Closed mkarczewski85 closed 4 years ago
@mkarczewski85 - thanks for reporting this issue. We highly appreciate these fixes by developers like you from open source community. Would you care to create a PR for this fix ? Currently master branch points to v2.3.x release train. If you are using v2.2.x or v2.1.x versions, please checkout from branch which represents these versions.
@kushagraThapar thank you for replying. I've just created PR.
Method generateBetween() of AbstractQueryGenerator class gives the same parameters names ("start", "end") for every Criteria of type BETWEEN in the query. Their names aren't unique, so when trying to execute query you get:
com.azure.data.cosmos.CosmosClientException: Gateway Failed to Retrieve Query Plan: Message: {"Errors":["Invalid query. Specified duplicate parameter name '@start'."]}
You cannot perform more complex queries which includes more than one Criteria of type BEETWEEN. You can easily fix by concatenating value of criteria.getSubject() with "start" nad "end". After that parameters for query will be unique. Effect should look like this: