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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With