Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect results returned from GetItemQueryIterator #4339

Closed
AndriySvyryd opened this issue Mar 5, 2024 · 7 comments
Closed

Incorrect results returned from GetItemQueryIterator #4339

AndriySvyryd opened this issue Mar 5, 2024 · 7 comments
Assignees
Labels
customer-reported Issue created by a customer QUERY

Comments

@AndriySvyryd
Copy link

We are continuously addressing and improving the SDK, if possible, make sure the problem persist in the latest SDK version.

Describe the bug
The following query returns less results than expected

SELECT DISTINCT c["City"]
FROM root c
WHERE (c["Discriminator"] = "Customer")
ORDER BY c["CustomerID"]

To Reproduce
Run the attached project CosmosIssue.zip

Expected behavior
The query should return 69 results

Actual behavior
The query returns 68 results

Environment summary
SDK Version: 3.38.1
OS Version (e.g. Windows, Linux, MacOSX): Windows 11

Additional context
Worked correctly on 3.37.0

@Maya-Painter
Copy link
Contributor

@AndriySvyryd as a temporary mitigation, can you try setting EnableOptimisticDirectExecution = false in your QueryRequestOptions? Doing this in your repro resulted in the query returning the expected number of results.

@Maya-Painter
Copy link
Contributor

@AndriySvyryd After investigating this further we have discovered that enabling OptimisticDirectExecution was not the source of the issue, rather it exposed a latent bug in our backend. This issue will be fixed in our next backend release. No action will be needed from your side. I can update you here once the fix has been deployed to all regions.

Thanks for the repro, it was very helpful in getting to the root of the problem.

@Maya-Painter
Copy link
Contributor

@AndriySvyryd All regions should have received the fix at this point, could you confirm that the query now returns the expected number of results?

@AndriySvyryd
Copy link
Author

@Maya-Painter It still fails for Cosmos emulator v2.14.16. Do you know when a version with the fix would be released?

@Maya-Painter
Copy link
Contributor

@AndriySvyryd Unfortunately we don't know when new emulator versions will be released

@AndriySvyryd
Copy link
Author

Ok. When not running against the emulator I get the correct results now.

@Maya-Painter
Copy link
Contributor

@AndriySvyryd Thanks for checking. Closing this issue as resolved, please tag me if you have any further questions or concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issue created by a customer QUERY
Projects
None yet
Development

No branches or pull requests

4 participants