[Cosmos] Populate sourceCollectionRid for GSI container creation#48047
Draft
mbhaskar wants to merge 4 commits into
Draft
[Cosmos] Populate sourceCollectionRid for GSI container creation#48047mbhaskar wants to merge 4 commits into
mbhaskar wants to merge 4 commits into
Conversation
The service resolves the GSI/materialized-view source container by its
resource id (sourceCollectionRid). The SDK previously sent only
sourceCollectionId, causing the create/replace container request to fail
with BadRequest ("Unable to fetch source collection provided in the
Materialized View definition").
Read the source container to obtain its _rid and populate
sourceCollectionRid on the wire payload, mirroring the Java SDK behavior.
Applied to sync and async create_container / create_container_if_not_exists
(via delegation) and replace_container.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 2 pipeline(s). 8 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Some service versions return the GSI definition under the legacy materializedViewDefinition key. Normalize container read properties so the public globalSecondaryIndexDefinition field is always populated when a GSI definition is present, regardless of the backend contract version. Applied to sync and async ContainerProxy.read(). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The GSI build status is a read-only, server-populated field that may be absent from a container read response before the index build is tracked. Match the Java SDK contract (getStatus() returns null when absent) by asserting on status only when the service returns it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Normalize container properties returned by create_container and replace_container (sync and async) the same way as read(): promote the GSI definition to globalSecondaryIndexDefinition and drop the legacy materializedViewDefinition key entirely. The public surface now consistently exposes only globalSecondaryIndexDefinition, regardless of the backend contract version. Extend the live test to assert the create response surfaces globalSecondaryIndexDefinition and never contains materializedViewDefinition. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The service resolves the GSI/materialized-view source container by its resource id (sourceCollectionRid). The SDK previously sent only sourceCollectionId, causing the create/replace container request to fail with BadRequest ("Unable to fetch source collection provided in the Materialized View definition").
Read the source container to obtain its _rid and populate sourceCollectionRid on the wire payload, mirroring the Java SDK behavior. Applied to sync and async create_container / create_container_if_not_exists (via delegation) and replace_container.
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines