This PR changes the view creation to use create or replace view, which is atomic.
Previously, dbt-clickhouse would:
Create a new "temporary" view
Drop the current view (eek!)
Rename the new view to the current view
The above 3 steps aren't done in a single transactions, so any queries on the view that occur during the process may get errors that the view doesn't exist.
Ideally, the operations are done in a single, atomic operation. I.e. use create or replace view.
Summary
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
This PR changes the view creation to use
create or replace view
, which is atomic.Previously, dbt-clickhouse would:
The above 3 steps aren't done in a single transactions, so any queries on the view that occur during the process may get errors that the view doesn't exist.
Ideally, the operations are done in a single, atomic operation. I.e. use
create or replace view
.Summary
Checklist
Delete items not relevant to your PR: