Skip to content

Extended bulk copy support for Azure DW#1331

Merged
peterbae merged 16 commits intomicrosoft:devfrom
peterbae:bulkCopySupport
May 22, 2020
Merged

Extended bulk copy support for Azure DW#1331
peterbae merged 16 commits intomicrosoft:devfrom
peterbae:bulkCopySupport

Conversation

@peterbae
Copy link
Copy Markdown
Contributor

@peterbae peterbae commented May 7, 2020

Adds new connection property sendTemporalDataTypesAsStringForBulkCopy.

This connection property, when set to FALSE, will send DATE, DATETIME, DATIMETIME2 DATETIMEOFFSET, SMALLDATETIME, and TIME datatypes as their respective types instead of sending them as String.

Additionally, even without setting this connection string to FALSE, MONEY and SMALLMONEY datatypes will be sent as MONEY / SMALLMONEY datatypes instead of DECIMAL after these changes.

Note that with this connection property set to FALSE, the driver will only accept the default string literal formatof each temporal datatype, for example:

DATE: YYYY-MM-DD
DATETIME: YYYY-MM-DD hh:mm:ss[.nnn]
DATETIME2: YYYY-MM-DD hh:mm:ss[.nnnnnnn]
DATETIMEOFFSET: YYYY-MM-DD hh:mm:ss[.nnnnnnn] [{+|-}hh:mm]
SMALLDATETIME:YYYY-MM-DD hh:mm:ss
TIME: hh:mm:ss[.nnnnnnn]

I've created two separate test classes for this, one for normal cases and one for AE cases. The AE cases are not supported against Azure DW, but I wanted both normal and AE cases to be run against their respective supported servers without one of them not being run when they should be, therefore two separate test classes.

I also made a small change to AESetup.java so that it doesn't throw a NPE when I'm trying to debug/run tests locally through eclipse.

@ulvii ulvii added this to the 8.3.1 milestone May 8, 2020
@ulvii
Copy link
Copy Markdown
Contributor

ulvii commented May 11, 2020

Please apply the formatter to your changes.

Comment thread src/main/java/com/microsoft/sqlserver/jdbc/DDC.java Outdated
@ulvii ulvii added the Public API Changes in Public API label May 11, 2020
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java Outdated
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java Outdated
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java Outdated
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java Outdated
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java Outdated
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java Outdated
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 19, 2020

Codecov Report

Merging #1331 into dev will decrease coverage by 2.86%.
The diff coverage is 82.58%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev    #1331      +/-   ##
============================================
- Coverage     57.38%   54.52%   -2.87%     
+ Complexity     3732     3624     -108     
============================================
  Files           133      133              
  Lines         30089    30204     +115     
  Branches       4979     5002      +23     
============================================
- Hits          17267    16468     -799     
- Misses        10415    11390     +975     
+ Partials       2407     2346      -61     
Impacted Files Coverage Δ Complexity Δ
...oft/sqlserver/jdbc/SQLServerBulkCSVFileRecord.java 48.42% <ø> (ø) 24.00 <0.00> (ø)
...om/microsoft/sqlserver/jdbc/SQLServerResource.java 100.00% <ø> (ø) 4.00 <0.00> (ø)
.../microsoft/sqlserver/jdbc/SQLServerDataSource.java 84.13% <50.00%> (-1.56%) 165.00 <1.00> (-3.00)
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 61.68% <76.05%> (+10.75%) 331.00 <0.00> (+74.00)
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 58.00% <87.50%> (-3.63%) 466.00 <1.00> (-29.00)
...in/java/com/microsoft/sqlserver/jdbc/IOBuffer.java 64.73% <88.46%> (-0.14%) 0.00 <0.00> (ø)
...rc/main/java/com/microsoft/sqlserver/jdbc/DDC.java 47.82% <100.00%> (+0.48%) 122.00 <2.00> (+2.00)
.../com/microsoft/sqlserver/jdbc/SQLServerDriver.java 82.80% <100.00%> (-4.58%) 40.00 <0.00> (ø)
src/main/java/mssql/security/provider/MD4.java 0.00% <0.00%> (-89.48%) 0.00% <0.00%> (-16.00%)
...m/microsoft/sqlserver/jdbc/NTLMAuthentication.java 0.00% <0.00%> (-86.62%) 0.00% <0.00%> (-30.00%)
... and 33 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2323091...b49865f. Read the comment docs.

@peterbae peterbae merged commit f857e25 into microsoft:dev May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Public API Changes in Public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants