databricks / dbt-databricks

A dbt adapter for Databricks.
https://databricks.com
Apache License 2.0
195 stars 104 forks source link

`persist_docs` fails on `materialized_view` #702

Open GtheSheep opened 2 weeks ago

GtheSheep commented 2 weeks ago

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

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!

benc-db commented 2 weeks ago

I believe this is blocked right now. When I was testing column comments on MVs, I hit the same issue as you, and in fact, couldn't get them to stick on create either (this might have subsequently been fixed, since that was 4 months ago).

benc-db commented 2 weeks ago

I've reached out internally to find out what the plan is about this.