Open the4thamigo-uk opened 1 week ago
@BentsiLeviav I would like to implement a solution for this. I think we need to try to perform the ALTER
statement, but if it fails, then to fallback to the DROP
and CREATE
approach. However, the problem I have is that there doesnt seem to be a way in jinja or dbt to catch the exception if the ALTER
fails. I think maybe the only way is to add something to the adapter? Do you have any ideas/advice?
Describe the bug
Steps to reproduce
A
B
Expected behaviour
The update of the materialized view should be atomic, but data is lost in between the
drop
and thecreate
.For altering the SQL we should use the atomic
ALTER TABLE ... MODIFY QUERY
https://clickhouse.com/docs/en/sql-reference/statements/alter/view