Can anyone help with explanation of how to use Python code to join the tables in different projects in BigQuery and having different service accounts and separate keys for each project?
import logging
from google.cloud import bigquery
def get_data_from_bigquery():
creds = 'key.json'
client = bigquery.Client.from_service_account_json(creds) #Project 1 keys
logging.info('Starting BQ data fetch :')
testquery = \
"""
INSERT INTO `Project1.Dataset.Table`
SELECT DISTINCT o.VName,o.RName,a.Id,a.Name FROM `Project1.Dataset.Table` o
INNER JOIN `Project2.Dataset.Table` a ON o.Id = a.Id """
job_config = bigquery.QueryJobConfig()
testquery_query_job = client.query(testquery, job_config=job_config)
testquery_query_job.result()
return True