-
Notifications
You must be signed in to change notification settings - Fork 60
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
Cosmos Data Extension GetPropertyValue Fails with Nested Partition Key Path #175
Comments
Am I reading this right? You are defining a partition key that is an object? This sort of thing is not allowed. "partitionkeyvalue1": {
"partitionkeyvalue2": "<GUID>",
"somevaule4": "<GUID>",
"UserName": "<username>",
"othervalue": "<data>",
"othervalue3": "<data_2>"
} Partition keys must be strings. Partition key definitions for a container are an array with 1-3 properties that form a hierarchy of values. Ideally this would be a hierarchy innate to the data itself, (e.g. /companyId, /departmentId, /employeeId) but technically it can be any string values. |
Thanks for getting back to me. No, the container defines PartitionKeyPath of So partitionkeypath = /partitiionkeyvalue1/partitionkeyvalue2 The JSON within Cosmos looks like: {
"_segments": [],
"_executionLogs": [],
"partitionkeyvalue1": {
"partitionkeyvalue2": "stringvalue"
"idvalue_2": "idstring"
}
...
} |
Can you send me the json output for the partition key definition from You can't create a container with a partition key like what I'm seeing here. I want to be sure I'm clear on your partition key definition. Thanks. |
Here's the output: "partitionKey": {
"kind": "Hash",
"paths": [
"/partitionkeyvalue1/partitionkeyvalue2"
],
"systemKey": null,
"version": null
}, Thanks for your help. |
Ok got it :) You can't define a hierarchical partition key like this. This would only result in a single partition key of partitionkeyvalue2 with this path, "/partitionkeyvalue1/partitionkeyvalue2". Also the kind is incorrect for hierarchical and you need to specify version number as well. 2 is preferred for either type of partition key. If you were defining a hierarchical partition key it would need to look like this. "partitionKey": { |
Hi @markjbrown , I work with @cf-ehakin. I can provide some more context. We are not trying to define a hierarchical partition key; we are defining our partition key as pointing to a value that is nested inside the document, as per REF: https://learn.microsoft.com/en-us/azure/cosmos-db/partitioning-overview#choose-a-partition-key |
Ok, now I got it!!! Your property names were confusing me :) My spidy senses make me think this is an escaping issue. @bowencode do you have thoughts on this? Any chance you can try to repro? |
When transferring from Azure Blob Json source to Cosmos DB sink, the following error occurs if partition key path on destination DB is:
/partitionkeyvalue1/partitionkeyvalue2
Sink Settings are
Source Json is:
This produces an error:
This seems to be directly related to the GetPropertyValue method:
Is this something that can be addressed, or are we defining the partition key in a not best practice manner?
The text was updated successfully, but these errors were encountered: