Professional Cloud Developer Exam QuestionsBrowse all questions from this exam

Professional Cloud Developer Exam - Question 65


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?

Show Answer
Correct Answer: A

To resolve a permission error when executing queries with the BigQuery CLI, the service account needs specific roles that allow it to read data from the BigQuery tables and execute queries. The BigQuery Data Viewer role allows the service account to view the data, while the BigQuery Job User role allows the service account to run jobs, which includes executing queries. These roles meet the necessary requirements without granting excessive permissions, adhering to the principle of least privilege, thus making it the appropriate choice.

Discussion

11 comments
Sign in to comment
donchickOption: A
Dec 21, 2020

I think A is the correct one.

cloud_mkOption: A
Apr 2, 2021

Ans A only https://cloud.google.com/bigquery/docs/access-control#bigquery In Ans B Bigquery Data Editor is not required.

syu31svcOption: A
Jul 10, 2021

Principle of least privilege so A is the answer

tomato123Option: A
Aug 20, 2022

A is correct

omermahgoubOption: A
Jan 8, 2023

The correct answer is Option A. In order to allow the analytics system to execute queries against the BigQuery dataset, the service account must be granted the BigQuery Data Viewer and BigQuery Job User roles. The BigQuery Data Viewer role allows the service account to read data from tables, and the BigQuery Job User role allows the service account to run jobs, which includes executing queries. Option B is not a good solution because the BigQuery Data Editor role allows the service account to modify data in tables, which is not necessary to execute queries. Option C is not a good solution because creating a view in BigQuery and selecting from the view in the CLI will not resolve the permission issue. Option D is not a good solution because creating a new dataset and copying the source table to the new dataset will not resolve the permission issue.

ParagSanyashivOption: A
Jan 8, 2022

According to the best practice - "User should have least privilege i.e. only those permissions which are required to perform an operation" - Option A is Correct.

maxdannyOption: A
Jul 26, 2022

A it's correct for the principle of least privilege

RajanOption: A
Sep 20, 2023

A is correct.

theseawillclaimOption: A
Feb 13, 2024

A is the one. No need to edit data is specified.

santoshchauhanOption: A
Mar 8, 2024

A. Grant the service account BigQuery Data Viewer and BigQuery Job User roles. The permission error from the BigQuery CLI suggests that the service account used to execute the queries does not have the necessary permissions. To resolve this, you need to ensure that the service account has the appropriate roles: BigQuery Data Viewer role: This role allows the service account to read data from BigQuery tables and views. It's necessary for the service account to access and read the dataset against which the queries are being executed. BigQuery Job User role: This role allows the service account to create and run jobs in BigQuery, including query jobs, which is necessary for executing SQL queries.

thewalkerOption: A
Jul 17, 2024

The correct answer is A. Grant the service account BigQuery Data Viewer and BigQuery Job User roles. Here's why: BigQuery Data Viewer: This role allows the service account to read data from BigQuery tables. This is necessary for the BigQuery CLI to execute the SQL queries. BigQuery Job User: This role allows the service account to run queries and jobs in BigQuery. This is essential for the BigQuery CLI to execute the SQL queries and return results.

thewalker
Jul 17, 2024

Let's break down why the other options are less suitable: B. Grant the service account BigQuery Data Editor and BigQuery Data Viewer roles: While BigQuery Data Editor allows for data modification, it's not strictly necessary for executing queries. Granting BigQuery Data Viewer and BigQuery Job User roles is sufficient. C. Create a view in BigQuery from the SQL query and SELECT from the view in the CLI: * Creating a view can simplify queries, but it doesn't address the underlying permission issue. The service account still needs the necessary permissions to access the view and execute queries. D. Create a new dataset in BigQuery and copy the source table to the new dataset Query the new dataset and table from the CLI: This approach adds unnecessary complexity and data movement. It doesn't solve the permission issue.