
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 correct option is A. Here's why: - **A**: This approach efficiently serves predictions for individual user IDs by leveraging Bigtable for fast read operations, ensuring latency stays under 100 milliseconds. It's the most direct solution to the requirement. - **B**: Simply adding a WHERE clause and granting the BigQuery Data Viewer role doesn't address the latency requirement effectively. - **C**: Creating an Authorized View and sharing the dataset doesn't guarantee the low latency needed for serving predictions to individual users. - **D**: While this option involves reading results from the query, it doesn't specifically ensure low latency for individual user predictions. Option A stands out as it directly meets the requirement for serving predictions with minimal latency.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A data scientist has developed a BigQuery ML model and needs your help to set up an ML pipeline for serving predictions. Your REST API application must provide predictions for a single user ID with a latency of less than 100 milliseconds, using the query: SELECT predicted_label, user_id FROM ML.PREDICT (MODEL ‘dataset.model‘, table user_features). How can you establish the ML pipeline to meet these requirements?
A
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.
B
Add a WHERE clause to the query, and grant the BigQuery Data Viewer role to the application service account.
C
Create an Authorized View with the provided query. Share the dataset that contains the view with the application service account.
D
Create a Dataflow pipeline using BigQueryIO to read results from the query. Grant the Dataflow Worker role to the application service account.