简体   繁体   English

如何从开发机(localhost)运行Google Bigquery查询

[英]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? 如何通过开发机(本地主机)上的Java应用程序连接到Google BigQuery“表”并在BigQuery中查询表?

I am using the BigQuery java library https://cloud.google.com/bigquery/docs/reference/libraries 我正在使用BigQuery Java库https://cloud.google.com/bigquery/docs/reference/libraries

We want to deploy our java web application on-premise and send some data to BigQuery. 我们想在本地部署Java Web应用程序,然后将一些数据发送到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 本地开发用户 -为每个开发人员在项目中创建用户,每个用户都将在其帐户下进行身份验证(gcloud auth ...),然后API客户端库将仅获取身份验证

  2. Service accounts - create a service account, download the JSON file and use it for authentication. 服务帐户 -创建服务帐户,下载JSON文件并将其用于身份验证。 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. 为此,有2种方法:每个人1个文件(但这很冒险-安全起见...您应该经常轮换文件)或每个开发人员1个文件(因此1个服务帐户)...但这很难管理。

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 详情请参阅https://cloud.google.com/docs/authentication

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过usb访问dev机器localhost - Access dev machine localhost via usb 将引荐来源网址限制为debug / localhost(Google开发者控制台) - Limiting referrers to debug/localhost (google dev console) 如何从另一台计算机在一台计算机上运行可执行jar文件 - how to run executable jar file on one machine from other machine 如何在一台机器上针对另一台机器运行ant脚本? - how to run ant script from one machine targeting another machine? 如何使用Eclipse和Java从Google BigQuery接收数据? - How can I receive Data from Google BigQuery with Eclipse and Java? 如何从BigQuery导出数据并将其作为.csv存储在Google存储空间中 - How to export data from BigQuery and store it as .csv in Google Storage 如何从 Java 服务将数据批量插入 Google BigQuery? - how to batch insert data into Google BigQuery from a Java service? 如何从 BigQuery 流式传输(查询)数据作为 Siddhi 应用程序中的源 - How to stream (query) data from BigQuery as source in a Siddhi App 如何使用 JAVA API 从 BigQuery 查询数据 - How to query data from BigQuery using JAVA API 如何使用Google Bigquery的Java API以Json形式获取查询结果 - How to get query result in Json form using Java API of Google Bigquery
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM