-
Notifications
You must be signed in to change notification settings - Fork 426
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
Bulk Copy with SQL Variant type fails due to null sourceResultSet #2442
Comments
hi @hchenatsafe We do have tests for bulkcopy using the SQL Variant type, what are you doing different? Could you please provide us with a repro of the issue? |
Hi @lilgreenbird, thanks for following up! Your tests seem to be using writeToServer(ResultSet sourceData), which wouldn't run into this issue since sourceResultSet would be set here. Our application passes a source data object that implements ISQLServerBulkData, so we are using writeToServer(ISQLServerBulkData sourceData) where sourceResultSet seems to be set to null, and we run into this error when writeSqlVariant() is called |
Could you please include your repro code here along with the schema and connection string used |
It seems it would be a challenge to untangle our source to provide a clean repro. We'll leave this issue up to your consideration. Thanks for your assistance! |
thanks @hchenatsafe I can see in the code path that this would be an issue. Looks like this had been an issue since day 1, I will add this as an enhancement and add a note in the doc that this isn't supported right now. Thanks for reporting the issue to us! |
Facing the same issue. It's a blocker for implementing data transfer pipelines into tables having SQL Variant columns. |
Docs will be updated for 12.8 (07/31/24). |
Driver version
12.4.1.jre8
SQL Server version
Microsoft SQL Server 2014 (SP3-GDR) (KB5029184) - 12.0.6179.1 (X64)
Jul 27 2023 21:44:30
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.3 (Build 9600: ) (Hypervisor)
Client Operating System
Ubuntu 22.04
JAVA/JVM version
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7-Ubuntu-122.04.1)
OpenJDK 64-Bit Server VM (build 17.0.10+7-Ubuntu-122.04.1, mixed mode, sharing)
Table schema
Provide the table schema to repro the issue.
Problem description
Our application supports inserting using bulk copy, and we call
writeToServer(ISQLServerBulkData sourceData)
to do so. We are trying to add support for sql_variant type (-156), but we run into a NullPointerException when we pass a sourceData object containing that type.It appears that
writeSqlVariant()
relies on a sourceResultSet that is set to null inwriteToServer(ISQLServerBulkData sourceData)
Expected behavior
Bulk source data is written successfully.
Actual behavior
See the following trace
Error message/stack trace
The text was updated successfully, but these errors were encountered: