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.
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.