zillow / ctds

Python DB-API 2.0 library for MS SQL Server
MIT License
83 stars 12 forks source link

Azure SQL DataWarehouse BulkInsert Issue #19

Closed thihara closed 5 years ago

thihara commented 6 years ago

I've been trying to insert data into Azure SQL DataWarehouse via the bulk_insert method.

I keep getting the following error

110802;An internal DMS error occurred that caused this operation to fail. Details: Exception: System.IO.EndOfStreamException, Message: Attempted to read past the end of the stream.

Does anyone have an idea about what's going on?

I found an article with a similar issue that occurred due to the BIT data type. However the table doesn't have a BIT data type anymore, and I still see this error.

I've attached a small test to demonstrate the issue, but it requires access to a live Azure SQL Datawarehouse. datawarehouse_test.py.zip

EDIT:

System Info

OS : MacOS

Python Version: 3.6.3

FreeTDS Version Info :

Version: freetds v1.00.91 freetds.conf directory: /usr/local/etc MS db-lib source compatibility: no Sybase binary compatibility: no Thread safety: yes iconv library: yes TDS version: 7.3 iODBC: no unixodbc: no SSPI "trusted" logins: no Kerberos: no OpenSSL: yes GnuTLS: no MARS: no

SQL Datawarehouse Version :

Microsoft Azure SQL Data Warehouse - 10.0.9999.0 May 24 2018 06:48:29 Copyright (c) Microsoft Corporation

joshuahlang commented 6 years ago

What version of FreeTDS are you using?

thihara commented 6 years ago

@joshuahlang Added system information.

joshuahlang commented 6 years ago

Have you tried using TDS version 7.4?

thihara commented 6 years ago

@joshuahlang Yes, initial connection attempts were with TDS 7.4, however for some reason it fails for Azure Datawarehouse. I had to revert to TDS 7.3 to connect to the database.

joshuahlang commented 6 years ago

This is likely an issue with FreeTDS. Trying setting the TDSDUMP environment variable to a file of your choice to get FreeTDS to dump some verbose debugging information that may give some more insight into what exactly is going wrong.

joshuahlang commented 5 years ago

Closing due to no response.