Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

running a bigquery command across multiple projetcs

Is it possible to run a bq command which query a dataset on project X and stores the result on another dataset on project Y:

bq query  --destination_table=project_Y.dataset_1.table_1 "SELECT * FROM project_X.dataset2.table_2"

What about the credentials now that I have two projects involved? I only have set a service account credential for project_X using gcloud.

like image 705
Hajar Homayouni Avatar asked Nov 03 '25 00:11

Hajar Homayouni


1 Answers

Yes. Queries across multiple projects are supported.

The user (or service account) issuing the query will need to have the appropriate permissions on each project (and/or dataset).

You can read more about BigQuery permissions here: https://cloud.google.com/bigquery/docs/access-control

like image 57
Adam Lydick Avatar answered Nov 05 '25 16:11

Adam Lydick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!