Skip to content
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

setQueryTimeout not works when bulk copy to Azure Data Warehouse #803

Closed
tilumi opened this issue Sep 18, 2018 · 4 comments
Closed

setQueryTimeout not works when bulk copy to Azure Data Warehouse #803

tilumi opened this issue Sep 18, 2018 · 4 comments
Assignees
Projects

Comments

@tilumi
Copy link

tilumi commented Sep 18, 2018

Driver version

7.0.0.jre8

SQL Server version

Azure SQL Data Warehouse Gen1

Client Operating System

Ubuntu

JAVA/JVM version

1.8

Problem description

  1. I use the method mention here: https://github.com/Microsoft/mssql-jdbc/wiki/How-to-enable-Bulk-Copy-API-for-batch-insert-operations to bulk copy data to Data Warehouse

  2. I use insertStatement.setQueryTimeout(10 * 60) to set timeout.

  3. I don't specify timeout properties on connection string.

  4. Expected behaviour: Timeout exception will be thrown after 10 mins

  5. Actual behaviour:
    Timeout exception thrown only after 1 min, like this:
    screenshot 2018-09-18 14 59 14

  6. Error message/stack trace:

2018-09-18 06:54:33 Executor task launch worker for task 486 ERROR Executor:91 - Exception in task 162.0 in stage 9.0 (TID 486)
java.sql.BatchUpdateException: The query has timed out.
	at com.shaded.com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(SQLServerPreparedStatement.java:2022)
	at com.microsoft.antispam.outputWriters.SQLDataWarehouseWriter$$anonfun$5$$anonfun$apply$1$$anonfun$6.apply(SQLDataWarehouseWriter.scala:89)
	at com.microsoft.antispam.outputWriters.SQLDataWarehouseWriter$$anonfun$5$$anonfun$apply$1$$anonfun$6.apply(SQLDataWarehouseWriter.scala:89)
	at scala.util.Try$.apply(Try.scala:192)
@peterbae peterbae self-assigned this Sep 18, 2018
@peterbae
Copy link
Contributor

Hi @tilumi, thanks for reporting this issue. The team has confirmed that this was not the intended behavior, and we'll be pushing a fix for this soon. We will let you know when we have an update.

@tilumi
Copy link
Author

tilumi commented Sep 19, 2018

Ok, thanks a lot

@peterbae
Copy link
Contributor

peterbae commented Oct 1, 2018

Hi @tilumi, I've made PR #817 to fix this issue. In the meantime, I've created this jar for you to use. Please let me know if this jar solves your problem.

issue-803-fix-jre8.zip

peterbae added a commit that referenced this issue Oct 26, 2018
)

Fix | setQueryTimeout doesn't work when performing bulk copy to Azure Data Warehouse (#803)
@peterbae
Copy link
Contributor

Fixed in #817, closing issue.

MSSQL JDBC automation moved this from To do to Closed Issues Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
MSSQL JDBC
  
Closed Issues
Development

No branches or pull requests

2 participants