Skip to content

Conversation

@dlouseiro
Copy link
Contributor

@dlouseiro dlouseiro commented Jan 12, 2026

Summary

Fixes #506.

Implementation details:

  • Add new config option catchup_on_full_refresh which ignores table backfilling when this setting is set to False, similar to what happens with the catchup option
  • (while there) Consolidated logic to create materialized view tables in new macro clickhouse__create_target_table, reducing code duplication.

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

Note

Introduces an option to control materialized view backfilling during explicit full refresh and consolidates table creation logic.

  • Adds catchup_on_full_refresh config for MVs; when False, dbt run --full-refresh recreates the table without backfilling, while initial creation remains governed by catchup
  • Refactors MV table creation into clickhouse__create_target_table and updates materialized_view.sql to use it for both initial creation and full refresh paths
  • Extends integration tests: updates parameterized MV model and adds test_catchup_on_full_refresh to verify no backfill on full refresh while still ingesting new data
  • Updates CHANGELOG.md with the new feature and refactor note

Written by Cursor Bugbot for commit b694faa. This will update automatically on new commits. Configure here.

@koletzilla
Copy link
Contributor

koletzilla commented Jan 12, 2026

Thanks for the contribution! :D

Add new config option catchup_on_full_refresh which ignores table backfilling when this setting is set to False, similar to what happens with the catchup option

I'm thinking that maybe we just reuse the catchup variable to also apply for the backfilling when the table is recreated, so looks like we may not need a new variable for that. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to ignore backfill of MV when redeploying a model

2 participants