- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2024 10:00 AM
The best way to run a jobon ALTER TABLE SET ROW FILTER or SET MASK.
1. **Create the Function**
sql
CREATE FUNCTION <function_name> (<parameter_name> <parameter_type>, ..) RETURN {filter clause whose output must be a boolean};
2. **Apply the Row Filter or Mask to a Table**
ALTER TABLE statement.
sql
ALTER TABLE <table_name> SET ROW FILTER <function_name> ON (<column_name>, ..);
or
sql
ALTER TABLE <table_name> SET MASK <function_name> ON (<column_name>, ..);
3. **Run the Job/Trigger**
Please note that row filters or column masks should not be added to any table that you are accessing from single user clusters. This is commonly done in the context of Databricks Jobs.