sqlmesh icon indicating copy to clipboard operation
sqlmesh copied to clipboard

CI Fix - Clickhouse-Cloud CI Currently Failing

Open cmgoffena13 opened this issue 3 months ago • 1 comments

Link: https://github.com/SQLMesh/sqlmesh/actions/runs/32525879293/job/96916106556

This is broken code in sqlmesh/core/engine_adapter/clickhouse.py

AI Notes

Failing Tests tests/core/engine_adapter/integration/test_integration.py::test_ctas tests/core/engine_adapter/integration/test_integration.py::test_ctas_source_columns

What’s Wrong When SQLMesh creates a ClickHouse table from a SELECT (CREATE TABLE ... AS SELECT) and the table has a description, we stick COMMENT '...' into that statement. ClickHouse does not allow that there — it expects AS SELECT next, so the create fails with a syntax error.

Possible Fix

Don’t put the comment in the CTAS SQL. Create the table first, then set the comment with ALTER TABLE ... MODIFY COMMENT (that path already exists).

Easiest lever: set COMMENT_CREATION_TABLE = CommentCreationTable.

COMMENT_COMMAND_ONLY (same idea as views already use).

cmgoffena13 avatar Aug 21 '26 22:08 cmgoffena13

HI @cmgoffena13 I'd like to take this one Looks like the fix is adding COMMENT_CREATION_TABLE = CommentCreationTable.COMMENT_COMMAND_ONLY on ClickHouseEngineAdapter miroring what's already done for COMMENT_CREATION_VIEW — will confirm against the actual enum options before opening a pr Happy to be assigned!

cookieark7 avatar Aug 31 '26 10:08 cookieark7