ClickHouse / ClickHouse/clickhouse-odbc
"bad conversion" error
- Dominant language
- C
- Stars
- 285
- Forks
- 105
- Avg merge
- 3h 56m
- Merged PRs (30d)
- 3
Description
### 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 TABLE` statements for tables involved:
* Sample data for all these tables, use [clickhouse-obfuscator](https://github.com/ClickHouse/ClickHouse/blob/master/programs/obfuscator/Obfuscator.cpp#L42-L80) if necessary
```
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 180
PTR [Unknown attribute 180]
SWORD 4
SWORD * 0x000000FB037FD0BC
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code -1 (SQL_ERROR)
HDBC 0x000002481CE0A060
UWORD 180
PTR [Unknown attribute 180]
SWORD 4
SWORD * 0x000000FB037FD0BC
DIAG [HY000] Unsupported info type: 180 (1)
Microsoft.Mashu cc74-98e4 ENTER SQLGetDiagRecW
SQLSMALLINT 2
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
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
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
SQLHANDLE 0x000002481CE0A060
SQLSMALLINT 2
SQLWCHAR * 0x000000FB037FCE50
SQLINTEGER * 0x000000FB037FD030
SQLWCHAR * 0x000002483817FAC0
SQLSMALLINT 1024
SQLSMALLINT * 0x000000FB037FD028
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 77
PTR 0x000002481F85EC98
SWORD 100
SWORD * 0x000000FB037FD0EC
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 77
PTR 0x000002481F85EC98 [ 10] "03.80"
SWORD 100
SWORD * 0x000000FB037FD0EC (10)
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 6
PTR 0x000002481F1B4D88
SWORD 100
SWORD * 0x000000FB037FDE3C
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 6
PTR 0x000002481F1B4D88 [ 38] "CLICKHOUSEODBCW.DLL"
SWORD 100
SWORD * 0x000000FB037FDE3C (38)
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 7
PTR 0x000002481F1B4E48
SWORD 100
SWORD * 0x000000FB037FDE3C
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 7
PTR 0x000002481F1B4E48 [ 28] "1.3.0.20241018"
SWORD 100
SWORD * 0x000000FB037FDE3C (28)
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 17
PTR 0x000002481F1B4F00
SWORD 100
SWORD * 0x000000FB037FDE3C
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 17
PTR 0x000002481F1B4F00 [ 20] "ClickHouse"
SWORD 100
SWORD * 0x000000FB037FDE3C (20)
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 18
PTR 0x000002481F1B4FB0
SWORD 100
SWORD * 0x000000FB037FDE3C
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 18
PTR 0x000002481F1B4FB0 [ 20] "01.00.0000"
SWORD 100
SWORD * 0x000000FB037FDE3C (20)
Microsoft.Mashu cc74-98e4 ENTER SQLAllocHandle
SQLSMALLINT 3
SQLHANDLE 0x000002481CE0A060
SQLHANDLE * 0x000002481F1B6218
Microsoft.Mashu cc74-98e4 EXIT SQLAllocHandle with return code 0 (SQL_SUCCESS)
SQLSMALLINT 3
SQLHANDLE 0x000002481CE0A060
SQLHANDLE * 0x000002481F1B6218 ( 0x000002481CE0F600)
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 77
PTR 0x000002481F1B6268
SWORD 100
SWORD * 0x000000FB037FDE0C
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 77
PTR 0x000002481F1B6268 [ 10] "03.80"
SWORD 100
SWORD * 0x000000FB037FDE0C (10)
Microsoft.Mashu cc74-98e4 ENTER SQLGetInfoW
HDBC 0x000002481CE0A060
UWORD 6
PTR 0x000002481F1B6360
SWORD 100
SWORD * 0x000000FB037FDE4C
Microsoft.Mashu cc74-98e4 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x000002481CE0A060
UWORD 6
PTR 0x000002481F1B6360 [ 38] "CLICKHOUSEODBCW.DLL"
SWORD 100
SWORD * 0x000000FB037FDE4C (38)
```
Contributor guide
Research direction
Start with the SQLGetInfoW calls and the unsupported info type 180 shown in the attached ODBC trace. Reproduce the PowerBI table preview against the reported ClickHouse 21 and 24 instances, collecting the missing driver, OS, manager, server, schema, and sample-data details; done means the conversion failure is isolated and the preview behavior is verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100