- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2024 01:01 PM
I am trying to mask a column on a DLT materialized view - this is created using DLT syntax. I am not able set the column masking after creation. Appreciate any workaround.
alter DLT Materialized View alter column set MASK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2024 03:35 PM
Hello @kranthi2 , I hope you're doing well.
It seems that this command won't work for MVs, as it expected table. When trying to run the following command, for example:
[EXPECT_TABLE_NOT_VIEW.NO_ALTERNATIVE] 'ALTER TABLE ... ALTER COLUMN' expects a table but `catalog`.`schema`.`MV` is a view. SQLSTATE: 42809
Doc.: https://docs.databricks.com/en/tables/row-and-column-filters.html#apply-a-column-mask
In a MV, you will face the following message:
To add or remove column mask for Materialized Views, use the CREATE OR REPLACE statement
Which indicates that, for now, this operation is not possible for MVs.
If you believe this feature of adding column mask to MVs through ALTER TABLE/VIEW would be beneficial, you could submit an idea in Databricks' Ideas Portal.
Best regards,
Lucas Rocha
Technical Solutions Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2024 06:21 AM
Thank you. I will submit the idea.