Skip to content

Fully drop MV on materialization change #507

@BentsiLeviav

Description

@BentsiLeviav

Describe the bug

When a dbt model is switched from a materialized view to a view and redeployed, the old materialized view is not dropped. Instead, only the MV’s target table is removed. This leaves the MV object in place, causing problems when inserting data, such as:

Failed to insert data into ClickHouse (will be retried). Missing materialized view data is possible due to ClickHouse deduplication: ClickHouse Error Code 48: Method write is not supported by storage View.

Steps to reproduce

  1. Create an MV.
  2. Redeploy it as a view.
  3. The MV does not get dropped, and the error message starts coming in.

Expected behaviour

Both the target table and the MV are supposed to be removed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions