Google Associate Cloud Engineer Question 149
Select 2Google Cloud PlatformYou are tasked with loading a large dataset from a CSV file stored in Google Cloud Storage into BigQuery. The data must be ingested without any schema definition errors, and you want to ensure that the process is efficient and cost-effective. Which of the following steps should you take to achieve this?
- A
Use BigQuery Data Transfer Service to load the data.
- B
Use the BigQuery web UI to manually define the schema before loading the data.
- C
Use the LOAD DATA SQL statement in BigQuery with schema auto-detection enabled.
- D
Use the bq command-line tool with the --autodetect flag to load the data.
- E
Convert the CSV file to a Google Sheets document before loading into BigQuery.
Show answer and explanation
Correct answers: C, D
Explanation
To efficiently and cost-effectively load data from a CSV file in Google Cloud Storage into BigQuery, it is best to use methods that leverage BigQuery's schema auto-detection capabilities. Both the LOAD DATA SQL statement with auto-detection and the bq command-line tool with the --autodetect flag allow BigQuery to automatically infer the schema, minimizing the risk of schema definition errors and streamlining the data loading process.
- A. Incorrect.
BigQuery Data Transfer Service is primarily used to automate data movement from SaaS applications to BigQuery, not for loading CSV files from Cloud Storage.
- B. Incorrect.
Manually defining the schema in the BigQuery web UI can be error-prone and time-consuming, especially for large datasets.
- C. Correct.
Using the LOAD DATA SQL statement with schema auto-detection allows BigQuery to infer the schema directly from the data, reducing potential errors and manual effort.
- D. Correct.
Using the bq command-line tool with the --autodetect flag is an efficient way to load data while allowing BigQuery to automatically determine the schema.
- E. Incorrect.
Converting a CSV file to a Google Sheets document is unnecessary for loading data into BigQuery and could introduce additional steps and costs.