A multinational company keeps all employee records in the BigQuery table hr.employee_raw. A second table, hr.region_map(user_email, country_code), lists which countries each HR analyst is allowed to see. HR analysts must be prevented from viewing rows outside their assigned countries, while the Finance team must retain unrestricted access to every row for global reporting. The engineering team wants to keep a single canonical table and create as few additional objects as possible. Which design should they implement?
Attach a row access policy to hr.employee_raw that filters rows by joining to hr.region_map, and grant this policy to the HR analyst group while assigning a separate TRUE policy to Finance users.
Apply a Data Catalog policy tag on the country_code column to hide the column from HR analysts, while granting Finance full access to the table.
Create a single authorized view that joins hr.employee_raw with hr.region_map filtering rows where hr.region_map.user_email = SESSION_USER(); grant HR analysts access to the view and allow Finance to query the base table.
Partition hr.employee_raw by country_code, copy each partition into its own dataset, and grant HR analysts access only to the datasets for their countries while Finance retains access to all datasets.
Row-level access policies in BigQuery cannot use subqueries or reference other tables, so they cannot filter hr.employee_raw based on hr.region_map. The simplest correct pattern is to create one authorized view that joins hr.employee_raw with hr.region_map on country_code and SESSION_USER(). Grant the HR analyst group access only to this view, while letting the Finance team query the base table directly. This approach enforces the required row-level restrictions, keeps a single source table, and introduces only one additional object-the view-with minimal administrative overhead. Partitioning or dataset-level IAM does not provide row-level security, and policy tags handle column, not row, access.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is an authorized view in BigQuery?
Open an interactive chat with Bash
How does SESSION_USER() work in BigQuery?
Open an interactive chat with Bash
Why can’t row-level access policies in BigQuery reference other tables?
Open an interactive chat with Bash
What is an authorized view in BigQuery?
Open an interactive chat with Bash
What does the `SESSION_USER()` function do in BigQuery?
Open an interactive chat with Bash
Why can't row-level access policies in BigQuery reference another table?
Open an interactive chat with Bash
GCP Professional Data Engineer
Designing data processing systems
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .