How to filter nested BigQuery data cost-effectively?
dataset.inventory_vm sample records: You have an inventory of VM data stored in the BigQuery table. You want to prepare the data for regular reporting in the most cost-effective way. You need to exclude VM rows with fewer than 8 vCPU in your report. What should you do? - 
Community Votes
100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests the ability to handle nested and repeated fields using UNNEST, while the trap is over-engineering the solution with materialized views or ETL tools for a simple filter.
To filter nested vCPU data in BigQuery for reporting, use a standard view with the UNNEST operator. The community agrees this is the most cost-effective method compared to materialized views or Dataflow pipelines.
Choosing a materialized view (Option B) is a common mistake because, while it improves performance, it incurs storage costs that are unnecessary for regular reporting requirements.
Community Discussion (6 comments)
- The table structure shows that the vCPU data is stored in a nested field within the components column. - Using the UNNEST operator to flatten the nested field and apply the filter.
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Option A is correct because the data schema contains nested fields (specificallyvCPU inside components), requiring the UNNEST operator to flatten the array for filtering. A standard view is the most cost-effective solution as it incurs no storage fees; users only pay for the query processing when the report runs. This fits the "regular reporting" use case perfectly without the overhead of managing infrastructure or paying for pre-computed storage.Why the Other Options Are Wrong
Option B is incorrect because materialized views store data physically, incurring storage costs which contradicts the "most cost-effective" requirement for a simple filter. Option C is incorrect because while a view is appropriate, theWITH clause alone does not handle the nested data structure; UNNEST is technically required to access the specific field. Option D is incorrect because using Dataflow to write to a new table introduces unnecessary infrastructure complexity, maintenance, and storage costs for a task that can be solved with a simple SQL view.Community Comment Notes
Commenters correctly identified that thevCPU data resides in a nested field, making UNNEST a strict necessity (Comments 1, 6). There was some confusion regarding materialized views, but the community clarified that the access frequency for "regular reporting" does not justify the storage costs of a materialized view, making a standard view the superior choice (Comment 3). Official Reference
Exam Strategy
Always look for keywords indicating data structure, such as "nested" or "repeated," which immediately point to the UNNEST operator. Additionally, prioritize standard SQL logic and views over ETL pipelines or materialized views unless the question explicitly demands high performance or real-time results.