cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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_Fatma
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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group