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

Collate is not generating a correct query

Open alessandrolulli opened this issue 5 months ago • 0 comments

Describe the bug The collate sqlalchemy function is not correctly handled in the Clickhouse dialect

To Reproduce from sqlalchemy.sql.operators import collate

query.collate(asc("display_name"), "en"))

it generates the following query: SELECT ... FROM test WHERE ... ORDER BY display_name ASC COLLATE en LIMIT 0, 300

Expected behavior The correct query should be: SELECT ... FROM test WHERE ... ORDER BY display_name ASC COLLATE 'en' LIMIT 0, 300

Also, using query.collate(asc("display_name"), "'en'")) is not fixing

Do you have any suggestions? Versions 0.3.0

alessandrolulli avatar Jan 24 '24 13:01 alessandrolulli