Problem
ClickHouse fails with the following error when queried via Power BI (ODBC) in DirectQuery mode:
DB::Exception: Cannot convert NULL value to non-Nullable type...
(CANNOT_INSERT_NULL_IN_ORDINARY_COLUMN)
This occurs even when the underlying schema defines the field as Nullable(Int32) or Nullable(Decimal).
Repro Case
SELECT CAST(persona_id AS Float64)
FROM clickhouse_dev.event
ClickHouse throws:
Code: 349. DB::Exception: Cannot convert NULL value to non-Nullable type...