Google Cloud Associate Data Practitioner — Question 30
Your organization uses a BigQuery table that is partitioned by ingestion time. You need to remove data that is older than one year to reduce your organization’s storage costs. You want to use the most efficient approach while minimizing cost. What should you do?
Answer options
- A. Create a scheduled query that periodically runs an update statement in SQL that sets the “deleted" column to “yes” for data that is more than one year old. Create a view that filters out rows that have been marked deleted.
- B. Create a view that filters out rows that are older than one year.
- C. Require users to specify a partition filter using the alter table statement in SQL.
- D. Set the table partition expiration period to one year using the ALTER TABLE statement in SQL.
Correct answer: D
Explanation
The correct answer is D because setting the partition expiration period to one year automatically removes old data, reducing storage costs efficiently. Options A and B merely filter or mark data without actually deleting it, while C does not address data removal directly and relies on user input, which is not efficient.