Google Professional Data Engineer Question 185
Single answerGoogle Cloud PlatformYou are working as a data engineer for a retail company that uses BigQuery to analyze sales data. To optimize queries that calculate the total daily revenue per store, you decide to create a materialized view. After creating the materialized view, you notice that some recent sales data is not reflected in the results. What could be the reason for this behavior?
- A
The base table used by the materialized view has not been updated.
- B
Materialized views in BigQuery are not updated in real-time and require periodic refreshes.
- C
The materialized view does not support querying the base table for recent updates.
- D
The materialized view logic has a syntax error that prevents it from updating.
Show answer and explanation
Correct answer: B
Explanation
Materialized views in BigQuery are designed to improve query performance by precomputing and storing results. However, they are not updated in real-time. Instead, they are refreshed periodically, which may cause a lag in reflecting recent changes to the base table. This behavior is intentional to balance performance and data freshness.
- A. Incorrect.
Incorrect. The base table can be up-to-date, but materialized views do not reflect changes immediately unless refreshed.
- B. Correct.
Correct. BigQuery materialized views are updated periodically, not in real-time. This is the likely reason for the missing recent sales data.
- C. Incorrect.
Incorrect. Materialized views in BigQuery can query the base table, but they do not automatically reflect real-time updates from the base table.
- D. Incorrect.
Incorrect. If there were a syntax error in the materialized view logic, it would not have been created successfully in the first place.