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:ย 

Unable to update DLT-based materialized view if clustering key is missing

Malthe
Contributor III

If we set up a materialized view with a clustering key, and then update the definition such that this key is no longer part of the table, Databricks complains:

Run ALTER TABLE ... CLUSTER BY ... to repair Delta clustering metadata.

But this is not possible and you can't do a full refresh either. One has to DROP the materialized view and recreate it (i.e. manual repair).

It should be possible to remedy this situation by doing a full refresh.

1 ACCEPTED SOLUTION

Accepted Solutions

K_Anudeep
Databricks Employee
Databricks Employee

Hello @Malthe ,

Currently, there is no supported way to repair broken clustering metadata in Delta materialised views if you remove the clustering key from the definition, other than dropping and recreating the materialised view. Additionally, a full refresh cannot resolve the underlying Delta clustering metadata inconsistency when the clustering key is removed or changed, as fullRefresh is meant for recomputing the data, not rewriting the MVโ€™s underlying Delta table properties (such as clustering keys).

I have checked this internally, and it appears to be a known issue that will be resolved and rolled out by the end of January 2026.

 

Anudeep

View solution in original post

1 REPLY 1

K_Anudeep
Databricks Employee
Databricks Employee

Hello @Malthe ,

Currently, there is no supported way to repair broken clustering metadata in Delta materialised views if you remove the clustering key from the definition, other than dropping and recreating the materialised view. Additionally, a full refresh cannot resolve the underlying Delta clustering metadata inconsistency when the clustering key is removed or changed, as fullRefresh is meant for recomputing the data, not rewriting the MVโ€™s underlying Delta table properties (such as clustering keys).

I have checked this internally, and it appears to be a known issue that will be resolved and rolled out by the end of January 2026.

 

Anudeep

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now