dbt-databricks icon indicating copy to clipboard operation
dbt-databricks copied to clipboard

Wrong command for dropping Materialized Views

Open ernestoongaro opened this issue 1 year ago • 3 comments

Describe the bug

When switching from materialized='materialized_view' to materialized='materialized_view' an incorrect statement is issued

11:40:17 Dropping relation `some`.`dbt_eongaro`.`test` because it is of type materializedview
11:40:17 On model.umc_poc.test: drop materializedview if exists `some`.`dbt_eongaro`.`test`
11:40:17 Databricks adapter: Error while running:
drop materializedview if exists `some`.`dbt_eongaro`.`test`

Steps To Reproduce

  1. Create a new model with `materialized='materialized_view'
  2. dbt run
  3. change model to `materialized='view'
  4. dbt run
  5. See error drop materializedview if exists `some`.`dbt_eongaro`.`test

Expected behavior

A clear and concise description of what you expected to happen.

System information

12:02:24 Running with dbt=1.7.7
12:02:24 Registered adapter: databricks=1.7.3

ernestoongaro avatar Feb 07 '24 12:02 ernestoongaro

Hmm, wonder why this wasn't reported sooner. This will be fixed soon when we upgrade materialized view behavior (hopefully next version if I've correctly fixed the too many 503 issues). I should have a beta out with this behavior this week or early next.

benc-db avatar Feb 07 '24 15:02 benc-db

Sorry for the delay, the beta with the fix is out today (1.8.0b1).

benc-db avatar Feb 26 '24 23:02 benc-db

https://github.com/databricks/dbt-databricks/discussions/595

benc-db avatar Feb 26 '24 23:02 benc-db