You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With SqlDialect::ClickhouseSQL, the SQL lowering follows DataFusion's semantics in three places where ClickHouse's differ, so the plan can return different rows or values from what ClickHouse would:
NULL ordering.ORDER BY x DESC lowers with nulls_first: true (DataFusion's default, nulls_max). ClickHouse puts NULLs last in both directions, so a top-k over a nullable column returns different rows.
Division.bytes / 2 on integers is typed Int64 and divides as integers (5 → 2). ClickHouse's / always returns Float64 (2.5).
countIf over no rows. It is rewritten to sum(CASE …), which is NULL over an empty input; ClickHouse returns 0.
The legacy SQL path has the same behaviour; #539 ported it unchanged.
Possible fix
Under ClickhouseSQL only:
set datafusion.sql_parser.default_null_ordering = "nulls_last";
Activity