You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
persist_docs not working for materialized views with append set to False #581
When creating a materialized view model, setting persist_docs to true in dbt_project.yml should add comments to the created table in Clickhouse. For materialized view models created with append = True, this works fine. However, when append = False then the table is recreated with the materialized view refresh, and doesn't keep the column descriptions.
Steps to reproduce
Set persist_docs: true in the project yaml file
Create a materialized view test_model.sql, with settings like the following:
version: 2
models:
- name: test_model
description: A test model
columns:
- name: col1
type: DateTime64
description: The first column
- name: col2
type: Date
description: The second column
Expected behaviour
The column descriptions should propagate to the Clickhouse column Comment field.
I tried setting schema specifically for the materialized view so that when it recreated the table that would get passed on, but it looks like materialized view schemas aren't pushed through at all.
I could not reproduce this on main (e563957, dbt-clickhouse 1.10.3) with ClickHouse 26.3. A refreshable materialized view without append, with persist_docs on for relation and columns, kept its table and column comments after dbt run and again after SYSTEM REFRESH VIEW had replaced the target table, with catchup both true and false. I tested with a MergeTree target, not the ReplacingMergeTree from the report, and I did not try older ClickHouse versions.
This is no longer reproducible on main with the default catchup: True (fixed as a side effect of #750, not released yet). It still reproduces with catchup: False when the query takes more than a moment to run: the first refresh replaces the target table after dbt has added the comments, so they are lost.
The catchup: False case is covered by #811. It persists the docs before the refreshable view is created, so the first refresh builds the replacement table with the comments in place. The new test uses catchup=False with a slow query; it passes on that branch and fails on main.
Activity
gedaliakliger commentedon Nov 17, 2026
I could not reproduce this on
main(e563957, dbt-clickhouse 1.10.3) with ClickHouse 26.3. A refreshable materialized view withoutappend, withpersist_docson for relation and columns, kept its table and column comments afterdbt runand again afterSYSTEM REFRESH VIEWhad replaced the target table, withcatchupboth true and false. I tested with aMergeTreetarget, not theReplacingMergeTreefrom the report, and I did not try older ClickHouse versions.koletzilla commentedon Nov 18, 2026
This is no longer reproducible on
mainwith the defaultcatchup: True(fixed as a side effect of #750, not released yet). It still reproduces withcatchup: Falsewhen the query takes more than a moment to run: the first refresh replaces the target table after dbt has added the comments, so they are lost.Keeping the issue open to track that case.
gedaliakliger commentedon Nov 18, 2026
The
catchup: Falsecase is covered by #811. It persists the docs before the refreshable view is created, so the first refresh builds the replacement table with the comments in place. The new test usescatchup=Falsewith a slow query; it passes on that branch and fails onmain.