Skip to content

Power BI DirectQuery: ClickHouse fails to parse ODBC parameter placeholders in expressions (e.g., CAST/LEFT) #501

@atifiu

Description

@atifiu

Problem

When connecting ClickHouse to Power BI using DirectQuery via the ClickHouse ODBC driver, Power BI generates queries like:

left(cast(`persona_id` as String), {odbc_positional_1:Nullable(Int32)})

This syntax is valid for other ODBC-compliant databases (e.g., SQL Server, PostgreSQL), but ClickHouse throws a syntax error:

Expected colon between name and type. (SYNTAX_ERROR)

Environment
ClickHouse Version: 25.5.1.2782

ODBC Driver: 1.4.1.20250523

Client: Power BI (DirectQuery mode)

Why this matters
This severely limits ClickHouse usage in DirectQuery mode for BI tools that rely on ODBC (Power BI, Tableau, etc.), and there's currently no workaround that:

Preserves NULLs

Avoids SQL generation errors

Keeps full BI tool functionality without rewriting queries in views

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions