google-big-queryHow do I set up a Google BigQuery access key?
- To set up a Google BigQuery access key, you will need to create a service account.
- Go to the Google Cloud Platform Console, select the project you want to use, and open the IAM & Admin page.
- Click the + CREATE SERVICE ACCOUNT button at the top of the page.
- Enter a name and description for the service account, and select Furnish a new private key.
- Select the JSON key type.
- Click Create. A JSON key file will be downloaded to your computer.
- You can use the credentials in the JSON key file to authenticate to BigQuery.
Example code block:
from google.cloud import bigquery
# Construct a BigQuery client object.
client = bigquery.Client.from_service_account_json('/path/to/key.json')
Code explanation
from google.cloud import bigquery: imports the BigQuery client libraryclient = bigquery.Client.from_service_account_json('/path/to/key.json'): creates a BigQuery client object from the credentials in the JSON key file
Helpful links
More of Google Big Query
- ¿Cuáles son las ventajas y desventajas de usar Google BigQuery?
- How do I use a Google BigQuery URL?
- How can I use Google BigQuery to access Wikipedia data?
- How can I use Google Big Query to count the number of zeros in a given dataset?
- How do I use wildcards in Google BigQuery?
- How can I compare Google BigQuery, Snowflake, and Redshift for software development?
- How do I limit the results of a query in Google Big Query?
- How do Google BigQuery and MySQL compare in terms of performance and scalability?
- How can I determine the length of a string in Google BigQuery?
- How can I use Google BigQuery to retrieve data from a specific year?
See more codes...