GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice question 15 of 35
Your analytics system executes queries against a BigQuery dataset. The SQL query is executed in batch and passes the contents of a SQL file to the BigQuery CLI. Then it redirects the BigQuery CLI output to another process. However, you are getting a permission error from the BigQuery CLI when the queries are executed. You want to resolve the issue. What should you do?
Full set: 265 questionsTo resolve the permission error, the service account needs two specific sets of permissions. First, to execute any query, it must have the permission to create a job in BigQuery. The BigQuery Job User (roles/bigquery.jobUser) role grants this necessary bigquery.jobs.create permission. Second, for the query to read data from the tables within the dataset, the service account needs permission to access that data. The BigQuery Data Viewer (roles/bigquery.dataViewer) role provides the required bigquery.tables.getData permission. Granting this combination of roles resolves the error by providing the minimum required permissions for the described task.
B. This option is incorrect because the BigQuery Data Editor role does not grant the bigquery.jobs.create permission, which is essential for initiating any query job.
C. Creating a view is a workaround that does not fix the root permission issue. The service account would still lack the necessary permissions to query the view.
D. Copying the entire table is an inefficient solution that creates data redundancy and does not address the fundamental lack of permissions on the service account.
1. Google Cloud Documentation, BigQuery Access Control, Predefined roles and permissions: This official document details the permissions included in each predefined BigQuery role.
BigQuery Job User (roles/bigquery.jobUser): "Provides permissions to run jobs, including queries... Includes the bigquery.jobs.create permission."
BigQuery Data Viewer (roles/bigquery.dataViewer): "When applied to a dataset, provides read-only access to the dataset's tables and views... Includes the bigquery.tables.getData permission."
BigQuery Data Editor (roles/bigquery.dataEditor): The list of permissions for this role does not include bigquery.jobs.create.
Source: Google Cloud Documentation, "Predefined roles and permissions", cloud.google.com/bigquery/docs/access-control#bigquery.predefined-roles.
2. Google Cloud Documentation, Running batch query jobs: This guide explicitly states the permission required to run a query job.
"To run a query job, you must have the bigquery.jobs.create IAM permission."
Source: Google Cloud Documentation, "Run an interactive or batch query job", cloud.google.com/bigquery/docs/running-queries#requiredpermissions.
Keep practicing
Take the free GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice questions
- Question 1You have an application controlled by a managed instance group. When you deploy a new ver…
- Question 2Your service adds text to images that it reads from Cloud Storage. During busy times of t…
- Question 3You have been tasked with planning the migration of your company’s application from on-pr…
- Question 4You plan to make a simple HTML application available on the internet. This site keeps inf…
- Question 5HipLocal's APIs are showing occasional failures, but they cannot find a pattern. They wan…
- Question 6Your company has created an application that uploads a report to a Cloud Storage bucket. …
