feat: bulk document import via executeBulkOperations#3145
Open
bk201- wants to merge 2 commits into
Open
Conversation
Contributor
🎭 E2E Tests (Playwright + VS Code)Commit: 6dd2939 🧪 Result
📥 Artifacts (run)
|
Contributor
🔨 Build, Lint & Test🔗 Source
📦 Package Information
🧪 Test Results
📥 Artifacts (run)✅ Build StatusBuild and local tests passed. See sibling comments below for E2E and NoSQL integration results. |
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.
Summary
Replaces the per-document
items.createloop inimportDocumentswith chunked bulk insertion viaexecuteBulkOperations(the modern, non-deprecated@azure/cosmosAPI — same pattern used inDocumentSession.processBulkDeleteBatch).Changes
items.executeBulkOperations.429) documents are retried up to 10 times, honoringx-ms-retry-after-mswith backoff.executeBulkOperations) is retried one-by-one.id(UUID) for documents missing one.cancellable: true+CancellationToken).extractPartitionKey.Why not #2692
This supersedes #2692 for the CosmosDB NoSQL path and that PR can be closed:
items.bulk()(limit 100, no NoSQL throttling handling).getCosmosClient+ Mongo branch), whereas import is now CosmosDB-only and useswithClaimsChallengeHandling.Follow-up
The buffering idea from #2692 is valuable for a streaming import scenario (large JSONL/NDJSON files that should not be loaded fully into memory). Tracked separately in #3144.