When a dbt incremental model is run on MotherDuck, the otherwise temporary table is created as a regular table on the server in a dbt_temp schema, and the table is dropped afterwards (see #326). However, if something goes wrong with the dbt run, the table persists. This PR adds the drop_relation call to the pre-model hook such that the "temporary" table is dropped beforehand if it still exists.
When a dbt incremental model is run on MotherDuck, the otherwise temporary table is created as a regular table on the server in a
dbt_temp
schema, and the table is dropped afterwards (see #326). However, if something goes wrong with the dbt run, the table persists. This PR adds thedrop_relation
call to the pre-model hook such that the "temporary" table is dropped beforehand if it still exists.