
Answer-first summary for fast verification
Answer: Create a BigQuery table partitioned by datetime value of the weather date. Set up partition expiration to 30 days.
The correct answer is B. Creating a BigQuery table partitioned by the datetime value of the weather date and setting up partition expiration to 30 days is the most efficient and cost-effective method. This approach directly addresses the requirement to only keep the last 30 days of weather data without needing to rely on additional scheduled queries for deletion, unlike the other methods. Partitions in BigQuery can be set to daily granularity, which would effectively manage the retention policy specified.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You are employed by an airline company, and your task is to manage weather data efficiently using a BigQuery table. This weather data will serve as input for a machine learning model that exclusively relies on the last 30 days of weather data to make predictions. To minimize costs and avoid storing unnecessary data, what approach should you take?
A
Create a BigQuery table where each record has an ingestion timestamp. Run a scheduled query to delete all the rows with an ingestion timestamp older than 30 days.
B
Create a BigQuery table partitioned by datetime value of the weather date. Set up partition expiration to 30 days.
C
Create a BigQuery table partitioned by ingestion time. Set up partition expiration to 30 days.
D
Create a BigQuery table with a datetime column for the day the weather data refers to. Run a scheduled query to delete rows with a datetime value older than 30 days.