-
Notifications
You must be signed in to change notification settings - Fork 453
Fix to address bulk copy batch insert operation on persisted computed column #2855
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
Merged
muskan124947
merged 10 commits into
main
from
users/muskgupta/gitHubIssue_persisted_bulkCopy
Dec 8, 2025
Merged
Fix to address bulk copy batch insert operation on persisted computed column #2855
muskan124947
merged 10 commits into
main
from
users/muskgupta/gitHubIssue_persisted_bulkCopy
Dec 8, 2025
+65
−1
Conversation
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
Removed unused logging imports from the test file.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2855 +/- ##
============================================
- Coverage 56.46% 56.42% -0.05%
+ Complexity 4576 4564 -12
============================================
Files 151 151
Lines 34560 34560
Branches 5768 5768
============================================
- Hits 19516 19500 -16
- Misses 12429 12430 +1
- Partials 2615 2630 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
machavan
previously approved these changes
Dec 4, 2025
machavan
approved these changes
Dec 8, 2025
Ananya2
approved these changes
Dec 8, 2025
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.
Description
Bulk insert operations using useBulkCopyForBatchInsert failed when the target table contained computed persisted columns. The driver incorrectly validated the destination column ordinal against the total physical column count instead of the actual set of valid destination metadata columns, causing valid mappings to be rejected.
This PR updates the bulk copy column mapping validation logic to use destColumnMetadata.containsKey(...) rather than relying solely on destColumnCount. This ensures computed columns—which are not writable targets—no longer cause false failures during bulk copy.
GitHub Issue : Persisted Computed Columns Break useBulkCopyForBatchInsert
Problem
Bulk copy operations failed when the target table included a computed persisted column. The driver validated the destination column ordinal using the physical column count (destColumnCount), causing valid mappings to be incorrectly rejected. This resulted in the error:
"Column X is invalid. Please check your column mappings."
Fix
Replaced the ordinal comparison with proper validation:
This ensures:
Testing