简体   繁体   中英

How to run Google Bigquery query from dev machine (localhost)

How can I connect to Google BigQuery 'table' from Java app on my dev machine (localhost) and query the table in BigQuery?

I am using the BigQuery java library https://cloud.google.com/bigquery/docs/reference/libraries

We want to deploy our java web application on-premise and send some data to BigQuery.

I see two possible ways:

  1. Local development users - create users in the project for every developer, each will authenticate (gcloud auth ...) under their account and then the API client libs will just pick up the auth

  2. Service accounts - create a service account, download the JSON file and use it for authentication. For this there are 2 ways: 1 file for everybody (but it's risky - security wise... you should rotate the file often) or 1 file (thus 1 service account) for each developer... but this is harder to manage.

As in the end the app will be on premise I would personally go for the service accounts approach.

See more at https://cloud.google.com/docs/authentication

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM