Skip to content

Bug: Multiple physical_properties generates duplicate SETTINGS clauses for ClickHouse #5803

@SteZe85

Description

@SteZe85

When specifying more than one setting in physical_properties for a ClickHouse model, SQLMesh generates separate SETTINGS keywords for each property instead of combining them into a single comma-separated SETTINGS clause. This results in a ClickHouse syntax error.

MODEL (
    name stage.fct_orders,
    kind INCREMENTAL_BY_UNIQUE_KEY (
        unique_key orders_id
    ),
    storage_format ReplacingMergeTree(_version),
    physical_properties (
        order_by = (orders_id),
        min_age_to_force_merge_seconds = 3600,
        min_age_to_force_merge_on_partition_only = 1
    ),
    partitioned_by (toYYYYMM(date_purchased))
); 
CREATE TABLE IF NOT EXISTS "sql_mesh_stage"."fct_orders" 
ENGINE=ReplacingMergeTree(_version) 
ORDER BY ("orders_id") 
PARTITION BY ((toYYYYMM("date_purchased"))) 
SETTINGS min_age_to_force_merge_seconds = 3600 SETTINGS min_age_to_force_merge_on_partition_only = 1 AS ....

SQL Mesh Version: 0.234.1
ClickHouse Version: 26.4.2.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions