sqlmesh icon indicating copy to clipboard operation
sqlmesh copied to clipboard

Feature request: Support for Clickhouse Column codecs

Open pkotikalapudi opened this issue 6 months ago • 2 comments

Clickhouse provides compression on columns to yield better performance.

Right now there is nothing mentioned about codecs in documentation nor I could see any codecs related code in the limited capacity I explored the repository.

There is some slack discussion on how we can do some workarounds right now: context. But I think it would be difficult to scale when we have lot of columns/tables.

I see that dbt-clickhouse already provides this out of the box as column constraint. It would be great if we could have something similar and Sqlmesh can support this natively.

pkotikalapudi avatar Aug 15 '25 18:08 pkotikalapudi

As indicated in the slack thread (repeating here for convenience), right now SQLMesh does not have a way to specify column constraints at table creation, we can only run ALTER statements after table creation (using post-statements).

So there is currently no way to indicate to SQLMesh to issue the CODEC(ZSTD) part of:

CREATE TABLE foo (id UInt32 CODEC(ZSTD))

This will become possible if #4717 gets implemented

erindru avatar Aug 17 '25 22:08 erindru

Thanks for mentioning the underlying implementation issue. Looking forward for this feature!

pkotikalapudi avatar Aug 20 '25 21:08 pkotikalapudi