cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Delta Live Tables Materialised View Column Comment Error

bozhu
Contributor

While materialised view doc says MVs support columns comments, this does not seem like the case for MVs created by DLT. For example, when trying to add a comment to a MV created by DLT, it errors:

bozhu_0-1692702233893.png

Any ideas on when this will be fixed/supported?

4 REPLIES 4

Kaniz
Community Manager
Community Manager

Hi @bozhuThe issue you're experiencing seems to be a limitation of Materialized Views (MVs) created by Delta Live Tables (DLT). While the documentation for CREATE MATERIALIZED VIEW The syntax does mention the capability to add comments to columns via the column_comment parameter; this feature might not be fully supported for MVs created by DLT. The provided information does not explicitly state that column comments are not endorsed for MVs created by DLT. Still, it does outline several limitations and restrictions on how MVs can be managed.

For example, MVs do not support identity columns or surrogate keys, and you cannot run ad hoc OPTIMIZE or VACUUM commands against MVs. However, the issue with column comments is not explicitly mentioned. Since the error you're encountering is not directly addressed in the provided sources, it would be best to contact Databricks Support for further assistance.

Here are the sources used to provide this answer:
- [Docs: materialized-views](https://docs.databricks.com/sql/user/materialized-views.html)
- [Docs: sql-ref-syntax-ddl-create-materialized-view](https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-create-materialized-view.html)
- [Docs: index](https://docs.databricks.com/delta-live-tables/index.html)

bozhu
Contributor

Just to close the loop here that it seems DLT generated MVs now support column comments.

But it seems like you can only update column comment in the Unity Catalog UI, not via any SQL stataments?

SamAdams
New Contributor II

@bozhu confirmed, running into the same limitation still

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.