🔥 40% Off Crucial Exams Memberships — Deal ends today!

5 minutes, 25 seconds remaining!

GCP Professional Data Engineer Practice Question

Your analytics team has built a materialized view named mv_sales that pre-aggregates SUM(revenue) grouped by sale_date and region_id from the retail.sales_fact table. A Looker Studio dashboard issues the following SQL:

SELECT region_id, SUM(revenue) AS revenue
FROM `retail.sales_fact`
WHERE sale_date BETWEEN '2024-01-01' AND '2024-01-31'
GROUP BY region_id;

Under which condition will BigQuery automatically rewrite this query to read from mv_sales even though the dashboard does not mention the view?

  • Only if mv_sales is stored in the same dataset as sales_fact and both tables are clustered on sale_date and region_id.

  • When the materialized view holds the same aggregate functions and a superset of the query's GROUP BY columns, and the query's filters are compatible with those used to build the view.

  • When the session parameter ENABLE_MATERIALIZED_VIEW_REWRITE is set to TRUE; otherwise BigQuery never rewrites queries automatically.

  • Only if the dashboard explicitly replaces retail.sales_fact with mv_sales in the FROM clause.

GCP Professional Data Engineer
Preparing and using data for analysis
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot