Databricks Data Engineer Professional exam dumps

Databricks Data Engineer Professional practice question 215 of 313

Databricks Certified Data Engineer Professional. Professional level, Databricks. Free question with the correct answer and a full explanation.

Databricks Data Engineer Professional Question 215

Select 2

A company wants to restrict access to sensitive columns and rows in a Delta table containing employee data. They decide to use dynamic views in Databricks. The table employee_data has the following columns: employee_id, name, department, salary, and region. Only users in the HR department should see the salary column, and users should only see rows where their region matches the region assigned to them in the company's user metadata. As a data engineer, how would you implement this using dynamic views?

  1. A

    Create a dynamic view with a CASE statement to mask the salary column for non-HR users and filter rows based on the region column.

  2. B

    Create a dynamic view with a WHERE clause that checks the user's region and uses a conditional expression to hide the salary column for non-HR users.

  3. C

    Use a GRANT statement to provide access to the salary column only to HR users and filter rows based on the region column in the Delta table.

  4. D

    Use the is_member function in the dynamic view to check if the user belongs to the HR group and filter rows based on the region column.

  5. E

    Create a static view with filters for region and salary and grant access to the view only to HR users.

Show answer and explanation

Correct answers: A, D

Explanation

Dynamic views in Databricks allow for fine-grained access control by dynamically filtering rows and masking columns based on the user's context (e.g., group membership or metadata like region). The correct approach involves creating a dynamic view that uses the is_member function to check if the user belongs to the HR group, conditionally displays the salary column, and filters rows based on the region column. Static views and GRANT statements cannot provide the required dynamic behavior, and WHERE clauses alone cannot conditionally mask columns.

  • A. Correct.

    Correct: Using a CASE statement in the SELECT clause allows you to mask sensitive columns like salary for unauthorized users, and using a filter in the WHERE clause can restrict rows based on the region column.

  • B. Incorrect.

    Incorrect: Although a WHERE clause can filter rows based on region, it cannot be used to conditionally hide or mask columns like salary.

  • C. Incorrect.

    Incorrect: GRANT statements control access at the table or view level, not at the row or column level, which is required for this use case.

  • D. Correct.

    Correct: The is_member function can check group membership (e.g., HR users), and it can be combined with filtering logic to enforce both row-level and column-level access control in the dynamic view.

  • E. Incorrect.

    Incorrect: Static views do not allow for dynamic filtering based on the user context (e.g., their region or group membership). This approach would not meet the requirements.

Timed practice exam

Take a Databricks Data Engineer Professional practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam