[release/9.0] Properly implement support for Cosmos hierarchical partition keys #34560
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #34553
Backport of #34557
Description
One of the major Cosmos provider features introduced in EF Core 9.0 is the support for hierarchical partition keys. Unfortunately, an important part of the design was misunderstood, and the current implementation requires all parts of the hierarchical partition key to be provided by the user; where the major reason for using hierarchical partition keys is precisely to specify only some of the values, limiting the number of partitions that need to be scanned.
Customer impact
Users can't properly use the new hierarchical partition keys feature in Cosmos, which is a high-value 9.0 feature.
How found
During validation
Regression
No, new feature.
Testing
Added/adjusted in the PR.
Risk
Low. The code modified is in any case completely new in 9.0 - this fixes a new feature.