Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
340 views
in Technique[技术] by (71.8m points)

google cloud platform - BigQuery query is trying to hit through a wrong account during execution

The query is trying to hit an another account when I am trying to execute the query by selecting it's own account.

ACTIVE  ACCOUNT
        <SERVICE_ACCOUNT_1>@<PROJECT_ID_1>.iam.gserviceaccount.com
*       <SERVICE_ACCOUNT_2>@<PROJECT_ID_2>.iam.gserviceaccount.com

To set the active account, run:
    $ gcloud config set account `ACCOUNT`

Now I am executing the query of the table of the selected account <SERVICE_ACCOUNT_2>@<PROJECT_ID_2>.iam.gserviceaccount.com but I will get the error of Error processing job of the account '<SERVICE_ACCOUNT_1>@<PROJECT_ID_1>.iam.gserviceaccount.com' which is not selected above.

[hive@ip-172-42-50-253 gcs-service-account-key]$ bq query --format=csv --quiet 'select max(cast(uid as INT64)) from <PROJECT_ID_2>.<DATASET>.<TABLE>'

BigQuery error in query operation: Error processing job '<PROJECT_ID_1>:<JOB_ID>': Access Denied: Table
<PROJECT_ID_2>:<DATASET>.<TABLE>: User does not have permission to query table <PROJECT_ID_2>:<DATASET>.<TABLE>.

Why the query is getting permission error and why the query is trying to hit through an another account's table in the same database.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...