-
Notifications
You must be signed in to change notification settings - Fork 439
Extended bulk copy for batch insert support for temporal and money datatypes #2670
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
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2670 +/- ##
============================================
+ Coverage 51.62% 51.94% +0.32%
- Complexity 4008 4064 +56
============================================
Files 147 147
Lines 33800 33800
Branches 5650 5650
============================================
+ Hits 17448 17557 +109
+ Misses 13888 13815 -73
+ Partials 2464 2428 -36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
machavan
reviewed
Jun 4, 2025
...test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithBulkCopyTest.java
Outdated
Show resolved
Hide resolved
David-Engel
reviewed
Jun 9, 2025
...test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithBulkCopyTest.java
Outdated
Show resolved
Hide resolved
...test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithBulkCopyTest.java
Show resolved
Hide resolved
...test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithBulkCopyTest.java
Outdated
Show resolved
Hide resolved
...test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithBulkCopyTest.java
Show resolved
Hide resolved
machavan
approved these changes
Jun 11, 2025
David-Engel
approved these changes
Jun 13, 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
This PR addresses a customer reported issue.
The Bulk Copy API did not previously support batch inserts using useBulkCopyForBatchInsert=true for certain SQL Server data types such as DATETIME, DATE, MONEY, etc. As a result, these types were inserted row by row, degrading performance when handling large datasets.
According to official Microsoft documentation (see here), the following data types are not supported by the Bulk Copy API: MONEY, SMALLMONEY, DATE, DATETIME, DATETIMEOFFSET, SMALLDATETIME, TIME, GEOMETRY, and GEOGRAPHY.
Resolution details:
This PR extends support in the Bulk Copy API for the aforementioned data types. The updated behavior is as follows:
Note: This extended handling is not supported in Synapse Analytics (formerly SQL DW). In that environment, bulk copy operations for these data types will continue to fall back to row-wise inserts.
Testing
Test scenarios have been added to validate the behavior of the Bulk Copy API for the affected data types under the following configurations: