
Answer-first summary for fast verification
Answer: CREATE VIEW restricted_address AS SELECT cost, address FROM employees WHERE is_member(‘analyst‘) or address like %AUS%;
Understanding the difference between column-level and row-level security in Databricks is crucial. Row-level security is correctly implemented by filtering rows based on user group membership, as shown in option B. This approach uses the `is_member()` function in the WHERE clause to filter rows, ensuring that only authorized users can view specific data. Column-level security, on the other hand, involves restricting access to specific columns, which is not the focus of this question. The correct answer demonstrates the proper use of dynamic views for row-level security by applying a conditional filter that checks group membership.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can row-level security be correctly implemented in Databricks using dynamic views?
A
CREATE VIEW restricted_address AS SELECT cost, address FROM employees WHERE cost>=25000;
B
CREATE VIEW restricted_address AS SELECT cost, address FROM employees WHERE is_member(‘analyst‘) or address like %AUS%;
C
CREATE VIEW restricted_address AS SELECT cost CASE WHEN is_account_group_member(‘analyst‘) THEN address ELSE ‘RESTRICTED‘ END AS address FROM employees;
D
CREATE VIEW restricted_address AS SELECT cost CASE WHEN is_member(‘analyst‘) THEN address ELSE ‘RESTRICTED‘ END AS address FROM employees;
E
All of the above options signify row-level security in Databricks.
No comments yet.