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

`persist_docs` fails on `materialized_view`

Open GtheSheep opened this issue 1 year ago • 4 comments
trafficstars

Describe the bug

Seems related to #104 - Setting persist_docs on a materialized_view causes the execution of an ALTER TABLE statement, but this fails on materialized views, ALTER VIEW doesn't support comments, so would need to be added during creation.

Steps To Reproduce

  • Set model config.materialized = 'materialized_view
  • Set persist_docs = true
  • Run model

Expected behavior

The MVW to be created with comments on each column from the dbt yml

Screenshots and log output

[EXPECT_TABLE_NOT_VIEW.NO_ALTERNATIVE] 'ALTER TABLE ... CHANGE COLUMN' expects a table but <mvw location> is a view

System information

The output of dbt --version:

Core:
  - installed: 1.8.2
  - latest:    1.8.2 - Up to date!

Plugins:
  - spark:      1.8.0 - Up to date!
  - databricks: 1.8.1 - Up to date!

Python 3.10.12

Additional context

Happy to contribute if someone could point me towards a preferred approach for this!

GtheSheep avatar Jun 14 '24 10:06 GtheSheep