You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Packages impacted by this PR
@azure/cosmos
Issues associated with this PR
#23416
Describe the problem that is addressed by this PR
Added Hierarchical Partition Key Support
Refactored Definition of PartitionKey.
Old definition - type PartitionKey = PartitionKeyDefinition | string | number | unknown;
New definition - type PartitionKey = PrimitivePartitionKeyValue | PrimitivePartitionKeyValue[];
The main change here is
a) Separating out PartitionKeyDefinition [May seem like a breaking change. But the actual functions which need PartitionKeyDefinition were always taking PartitionKeyDefinition as an input i.e. ContainerDefinition, the existing definition seems confusing.]
b) Removal of unknown from definition (along with adding boolean). Defining it as PartitionKeyDefinition | string | number | unknown was effectively equivalent to unknown, since or of anything with unknown is unknown. Which essentially means we had no structure upon PartitionKey. This seems like a huge bug.
Introduced PartitionKeyInternal to create a boundary beyond with PartitionKey would be sanitized. The idea is to use ClientContext as that boundary.
Changed bulk/batch api Operation/OperationInput DTOs partitionKey field to PartitionKey type.
Clearly defined order for choosing partitionKey for an operation during bulk api. Now if the user has provided partitionKey in OperationInput it will be used, if not it will be derived from resource body (for create and upsert).
Added logic for MultiHash calculation.
Changed FeedOption.partitionKey filed to PartitionKey type.
[[Bugs fixes]]
In bulk api, The case when partition key path has escaped characters was not handled. In batch.ts -> deepFind() method.
In bulk/batch api Operation/OperationInput DTOs were inconsistent in supporting type of partition key values.
What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?
Are there test cases added in this PR? (If not, why?)
Yes
Provide a list of related PRs (if any)
Command used to generate this PR:**(Applicable only to SDK release request PRs)
Checklists
Added impacted package name to the issue description
Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
Added a changelog (if necessary)
Is your feature request related to a problem? Please describe.
https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys?tabs=net-v3%2Cbicep
With sub-partitioning customers can natively partition their container with up to three levels of partition keys
DOTNET SDK PR
Azure/azure-cosmos-dotnet-v3#1658
The text was updated successfully, but these errors were encountered: