Skip to content

Cosmos DB vNext Emulator Does not Support Numerical Partition Keys #188

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

Open
MapFilterMagic opened this issue Mar 31, 2025 · 0 comments
Open
Assignees
Labels
bug cosmosEmulatorVnextPreview issues raised for the vNext Linux based emulator (preview)
Milestone

Comments

@MapFilterMagic
Copy link

Describe the bug
If you use a numerical partition key, you will not be able to find the document on a read where you specify the partition key or do a partial document update, which includes the partition key.

Pointed my application at the emulator and started running into problems. It can do a normal save (upsert) just fine. But the find and patch won't work.

Narrowed it down to the fact that our model's partition key is a BigInteger. Tried int and long, but it was still failing to findById (point read) or patch anything, both of which require you to supply the partition key. Then I changed it to a String, and it had no issues. Otherwise, it cannot find the document you are looking for by that partition key.

Confirmed copying over this gentleman's test code into a Spring Boot project (assume it has nothing to do with Spring Boot): https://github.com/bitxon/java-cosmos-emulator-vnext-experiment

To Reproduce

  1. I copied over the code from https://github.com/bitxon/java-cosmos-emulator-vnext-experiment/blob/cdc42ee8704b53252afbc6bd8e96d557dcbd1934/src/test/java/bitxon/experiment/CosmosEmulatorVNextHttpTest.java

If you change the partition key to /age

Image

And then feed in the age value instead of the name when dumping in a new PartitionKey() in both cases, you run into it

Image

Image

Expected behavior
Might have missed this when looking the unsupported feature list, but it should be able to support numeric partition keys like it does in the cloud.

Desktop:

  • OS: m1 macOS 15.3.2
  • Version: vNext Emulator latest
  • SDK version:
    • Java (jdk21)
    • com.azure.spring:spring-cloud-azure-dependencies:5.21.0
    • org.springframework.boot:spring-boot-starter-parent:3.4.2
    • org.springframework.cloud: spring-cloud-dependencies:2024.0.0
    • com.azure.spring spring-cloud-azure-starter-data-cosmos
@MapFilterMagic MapFilterMagic added cosmosEmulatorVnextPreview issues raised for the vNext Linux based emulator (preview) needs-triage labels Mar 31, 2025
@xgerman xgerman assigned rochaudhary and unassigned xgerman Apr 2, 2025
@xgerman xgerman added this to the Backlog milestone Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cosmosEmulatorVnextPreview issues raised for the vNext Linux based emulator (preview)
Projects
None yet
Development

No branches or pull requests

3 participants