Practice Test 2 | Google Cloud Certified Professional Data Engineer | Dumps | Mock Test
An e-commerce company uses BigQuery as its main data warehouse. One of the tables stores customers details such as name, address, email and phone number. Data team wants to modify the table’s schema and add a new column called ‘zipcode’ which is previously included in address column. You are asked to modify the table’s schema and do necessary changes. You need to perform the changes with minimal costs. What should you do?
A. Add a new column called ‘zipcode’ to customers table. Run an update statement to extract zip code from address column and set it to the new column.
B. Create a view in BigQuery that extracts zip code from address as a new column.
C. Export table data from BigQuery to Google Storage. Use Dataproc to transform data and extract the zip code from addresses and append it as a new column. Create a new table for customers with new column ‘zipcode.’ Import transformed data to new table.
D. Create a Dataflow pipeline to read data from BigQuery, extract zip code from address column, then write data to a newly created table in BigQuery with ‘zipcode’ column.
Answer: A.
BigQuery allows partial modification on an existing table’s schema definition. The following actions are allowed:
- Adding columns to a schema definition.
- Relaxing a column’s mode from REQUIRED to NULLABLE.
Answer B is incorrect: BigQuery’s views are logical views, not materialized views.
Answer C & D are incorrect: Using Dataproc or Dataflow is not a cheap or simple solution comparing to updating the table directly from BigQuery.
Source(s):
BigQuery – Modifying Table Schemas: https://cloud.google.com/bigquery/docs/managing-table- schemas
BigQuery – Introduction to Views: https://cloud.google.com/bigquery/docs/views-intro
Comments are closed, but trackbacks and pingbacks are open.