Closed kaustubhpriye closed 3 years ago
@mbhaskar take a look when you get a chance. I think your PR might handle this already.
@mbhaskar - can you take a look with the new Distinct changes if this is addressed?
This will be handled in: https://github.com/Azure/azure-sdk-for-java/issues/6296
I'm just hitting this too, is there a workaround? Maybe encapsulating the DISTINCT VALUE result in something?
This issue is fixed in V4. https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/cosmos/azure-cosmos/CHANGELOG.md
When using a distinct query for a field foo_id, serialisation is failing with error Caused by: java.lang.ClassCastException: com.fasterxml.jackson.databind.node.TextNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
select DISTINCT VALUE c.foo_id from c
This should have returned list of string, but fails with error. Error happens when
JsonSerializable
tries to callfromJson
, in fromJson method, theJsonNode
is downcast toObjectNode
, while actually the instance is of typeTextNode
.ObjectMapper
is working properly.https://github.com/Azure/azure-cosmosdb-java/blob/81a56e9506827e647253b1b6ae39f95a7aee37a3/commons/src/main/java/com/microsoft/azure/cosmosdb/JsonSerializable.java#L492