PROFESSIONAL-CLOUD-DEVELOPER · Question #13
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 outp
The correct answer is A. Grant the service account BigQuery Data Viewer and BigQuery Job User roles.. To execute queries via the BigQuery CLI, a service account needs two distinct permissions: (1) BigQuery Data Viewer to read the data in the dataset, and (2) BigQuery Job User to actually create and run query jobs. The permission error occurs because running a query is a 'job' ope
Question
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?
Options
- AGrant the service account BigQuery Data Viewer and BigQuery Job User roles.
- BGrant the service account BigQuery Data Editor and BigQuery Data Viewer roles.
- CCreate a view in BigQuery from the SQL query and SELECT* from the view in the CLI.
- DCreate a new dataset in BigQuery, and copy the source table to the new dataset Query the new
How the community answered
(28 responses)- A71% (20)
- B4% (1)
- C18% (5)
- D7% (2)
Explanation
To execute queries via the BigQuery CLI, a service account needs two distinct permissions: (1) BigQuery Data Viewer to read the data in the dataset, and (2) BigQuery Job User to actually create and run query jobs. The permission error occurs because running a query is a 'job' operation - it's not enough to just read data; the service account must also be allowed to submit jobs. Option B is wrong because Data Editor adds write permissions (unnecessary and overprivileged) and still lacks the Job User role needed to run jobs. Options C and D are workarounds that do not fix the underlying permission issue.
Topics
Community Discussion
No community discussion yet for this question.