clickhouse-sqlalchemy icon indicating copy to clipboard operation
clickhouse-sqlalchemy copied to clipboard

query.count() with custom modifiers (sample) generates incorrect query

Open antonio-antuan opened this issue 5 years ago • 0 comments

session.query(...).count() That code generates something like that:

select count(*) from (
select ...
from table
) anon_1

If I trying to use sample, query will look like that:

session.query(...).sample(0.1)
select count(*) from (
select ...
from table
sample 0.1
) anon_1
sample 0.1

The same problem appears with ARRAY JOIN

antonio-antuan avatar Jan 29 '19 16:01 antonio-antuan