clickhouse-odbc
clickhouse-odbc copied to clipboard
"bad conversion" error
Describe the bug
Attempted to use the new PowerBI connector. I was starting fresh, I downloaded PowerBI and installed the Clickhouse ODBC .msi today. I am able to reach the Clickhouse instance, I am authenticated and see all the tables, however when I try to use one, during the PowerBI "preview" of the table, it fails:
This happens for every table.
Don't currently know the exact Clickhouse server version and the rest of the details, will update as I find them if this isn't able to be diagnosed. - EDIT, same behavior on a v21 and a v24 Clickhouse instance.
I've attached part of the ODBC tracing logs below: the first SQL_ERROR and what appears to be relevant diagnostics
Configuration
Environment
- Driver version:
- OS:
- ODBC Driver manager:
ClickHouse server
- ClickHouse Server version:
- ClickHouse Server non-default settings, if any:
CREATE TABLEstatements for tables involved:- Sample data for all these tables, use clickhouse-obfuscator if necessary
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 180 <unknown>
PTR [Unknown attribute 180]
SWORD 4
SWORD * 0x000000FB037FD0BC
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code -1 (SQL_ERROR)
HDBC 0x000002481CE0A060
UWORD 180 <unknown>
PTR [Unknown attribute 180]
SWORD 4
SWORD * 0x000000FB037FD0BC
DIAG [HY000] Unsupported info type: 180 (1)
Microsoft.Mashu cc74-98e4 ENTER SQLGetDiagRecW
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x000002481CE0A060
SQLSMALLINT 1
SQLWCHAR * 0x000000FB037FCE50
SQLINTEGER * 0x000000FB037FD030
SQLWCHAR * 0x000002483817FAC0
SQLSMALLINT 1024
SQLSMALLINT * 0x000000FB037FD028
Microsoft.Mashu cc74-98e4 EXIT SQLGetDiagRecW with return code 0 (SQL_SUCCESS)
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x000002481CE0A060
SQLSMALLINT 1
SQLWCHAR * 0x000000FB037FCE50 [ 5] "HY000"
SQLINTEGER * 0x000000FB037FD030 (1)
SQLWCHAR * 0x000002483817FAC0 [ 26] "Unsupported info type: 180"
SQLSMALLINT 1024
SQLSMALLINT * 0x000000FB037FD028 (26)
Microsoft.Mashu cc74-98e4 ENTER SQLGetDiagRecW
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x000002481CE0A060
SQLSMALLINT 2
SQLWCHAR * 0x000000FB037FCE50
SQLINTEGER * 0x000000FB037FD030
SQLWCHAR * 0x000002483817FAC0
SQLSMALLINT 1024
SQLSMALLINT * 0x000000FB037FD028
Microsoft.Mashu cc74-98e4 EXIT SQLGetDiagRecW with return code 100 (SQL_NO_DATA_FOUND)
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x000002481CE0A060
SQLSMALLINT 2
SQLWCHAR * 0x000000FB037FCE50
SQLINTEGER * 0x000000FB037FD030
SQLWCHAR * 0x000002483817FAC0
SQLSMALLINT 1024
SQLSMALLINT * 0x000000FB037FD028
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 77 <SQL_DRIVER_ODBC_VER>
PTR 0x000002481F85EC98
SWORD 100
SWORD * 0x000000FB037FD0EC
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 77 <SQL_DRIVER_ODBC_VER>
PTR 0x000002481F85EC98 [ 10] "03.80"
SWORD 100
SWORD * 0x000000FB037FD0EC (10)
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 6 <SQL_DRIVER_NAME>
PTR 0x000002481F1B4D88
SWORD 100
SWORD * 0x000000FB037FDE3C
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 6 <SQL_DRIVER_NAME>
PTR 0x000002481F1B4D88 [ 38] "CLICKHOUSEODBCW.DLL"
SWORD 100
SWORD * 0x000000FB037FDE3C (38)
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 7 <SQL_DRIVER_VER>
PTR 0x000002481F1B4E48
SWORD 100
SWORD * 0x000000FB037FDE3C
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 7 <SQL_DRIVER_VER>
PTR 0x000002481F1B4E48 [ 28] "1.3.0.20241018"
SWORD 100
SWORD * 0x000000FB037FDE3C (28)
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 17 <SQL_DBMS_NAME>
PTR 0x000002481F1B4F00
SWORD 100
SWORD * 0x000000FB037FDE3C
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 17 <SQL_DBMS_NAME>
PTR 0x000002481F1B4F00 [ 20] "ClickHouse"
SWORD 100
SWORD * 0x000000FB037FDE3C (20)
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 18 <SQL_DBMS_VER>
PTR 0x000002481F1B4FB0
SWORD 100
SWORD * 0x000000FB037FDE3C
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 18 <SQL_DBMS_VER>
PTR 0x000002481F1B4FB0 [ 20] "01.00.0000"
SWORD 100
SWORD * 0x000000FB037FDE3C (20)
Microsoft.Mashu cc74-98e4 ENTER SQLAllocHandle
SQLSMALLINT 3 <SQL_HANDLE_STMT>
SQLHANDLE 0x000002481CE0A060
SQLHANDLE * 0x000002481F1B6218
Microsoft.Mashu cc74-98e4 EXIT SQLAllocHandle with return code 0 (SQL_SUCCESS)
SQLSMALLINT 3 <SQL_HANDLE_STMT>
SQLHANDLE 0x000002481CE0A060
SQLHANDLE * 0x000002481F1B6218 ( 0x000002481CE0F600)
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 77 <SQL_DRIVER_ODBC_VER>
PTR 0x000002481F1B6268
SWORD 100
SWORD * 0x000000FB037FDE0C
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 77 <SQL_DRIVER_ODBC_VER>
PTR 0x000002481F1B6268 [ 10] "03.80"
SWORD 100
SWORD * 0x000000FB037FDE0C (10)
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 6 <SQL_DRIVER_NAME>
PTR 0x000002481F1B6360
SWORD 100
SWORD * 0x000000FB037FDE4C
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 6 <SQL_DRIVER_NAME>
PTR 0x000002481F1B6360 [ 38] "CLICKHOUSEODBCW.DLL"
SWORD 100
SWORD * 0x000000FB037FDE4C (38)
during the PowerBI "preview" of the table,
Could you share your DDL? Could you inspect a column for non-UTF8 characters? see https://github.com/ClickHouse/clickhouse-odbc/issues/383#issuecomment-994834602
Thank you for reporting this issue. Unfortunately, there isn't enough information in this ticket to reproduce or investigate the problem. To better understand the issue, we need details about the structure of the table you are trying to preview. Specifically, could you provide the CREATE TABLE statement for any of the tables you are experiencing issues with? Without additional information, we may have to close the ticket as unreproducible.
I encountered the same issue. It seems that this is a corrupted UTF-8 byte sequence. If it's corrupted, it needs to be replaced with appropriate characters. I was able to reproduce the issue with the data below and the Unicode driver. There's also a possibility that the chunked transfer encoding processing is incomplete.
ALTER TABLE {TABLE_NAME} UPDATE {UTF8STRING_COLUMN_NAME}=unbin('\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10') WHERE ID={ID};