cloudflare / sqlalchemy-clickhouse

Apache License 2.0
314 stars 105 forks source link

Adds support for passing arguments to the count function #28

Closed eirikur-as closed 6 years ago

eirikur-as commented 6 years ago

While using Apache Superset with Clickhouse, I discovered that the COUNT DISTINCT aggregate function was not working properly. The generated query would always just call count() with no arguments, resulting in a count of all values, rather than unique values.

After some digging, I found that this problem appears to have been fixed in an alternative implementation of a Clickhouse dialect for SQLAlchemy, namely in this commit, with corresponding unit test modifications in this commit.

This pull request simply ports that fix over to sqlalchemy-clickhouse.

vavrusa commented 6 years ago

Thanks @eirikur-as !