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).
Link: https://github.com/SQLMesh/sqlmesh/actions/runs/32525879293/job/96916106556
This is broken code in
sqlmesh/core/engine_adapter/clickhouse.pyAI Notes
Failing Tests
tests/core/engine_adapter/integration/test_integration.py::test_ctastests/core/engine_adapter/integration/test_integration.py::test_ctas_source_columnsWhat’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).