
Answer-first summary for fast verification
Answer: Create a Dataflow pipeline using BigQueryIO to read predictions for all users from the query. Write the results to Bigtable using BigtableIO. Grant the Bigtable Reader role to the application service account so that the application can read predictions for individual users from Bigtable.
The key requirements are serving predictions for individual user IDs with low (sub-100ms) latency. Option D meets this by batch predicting for all users in BigQuery ML, writing predictions to Bigtable for fast reads, and allowing the application access to query Bigtable directly for low latency reads. Other options either require changing the query for each user ID (higher latency), reading directly from higher latency services like BigQuery, or writing predictions somewhere without fast single row access. Therefore, Option D is the best choice.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A data scientist has developed a BigQuery ML model and has requested your assistance in establishing a machine learning (ML) pipeline to facilitate predictions. Currently, you operate a REST API application that comes with a specific requirement to serve predictions for individual user IDs with a latency of less than 100 milliseconds. To achieve predictions, you utilize the following BigQuery ML query:
SELECT predicted_label, user_id FROM ML.PREDICT (MODEL 'dataset.model', table user_features).
What steps should you take to effectively create the ML pipeline to meet these requirements?
A
Add a WHERE clause to the query, and grant the BigQuery Data Viewer role to the application service account.
B
Create an Authorized View with the provided query. Share the dataset that contains the view with the application service account.
C
Create a Dataflow pipeline using BigQueryIO to read results from the query. Grant the Dataflow Worker role to the application service account.
D
Create a Dataflow pipeline using BigQueryIO to read predictions for all users from the query. Write the results to Bigtable using BigtableIO. Grant the Bigtable Reader role to the application service account so that the application can read predictions for individual users from Bigtable.