Google bigquery 是否可以使用脚本查询公共大查询数据集,而无需注册计费
是否可以查询公共大查询数据集,例如使用C/python脚本,而无需在Google大查询上注册计费。我使用了随附的C代码,但它没有给我足够的权限[403]错误Google bigquery 是否可以使用脚本查询公共大查询数据集,而无需注册计费,google-bigquery,Google Bigquery,是否可以查询公共大查询数据集,例如使用C/python脚本,而无需在Google大查询上注册计费。我使用了随附的C代码,但它没有给我足够的权限[403]错误 using System; using System.Collections.Generic; using System.Linq; using System.Text; using
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Security.Cryptography.X509Certificates;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Services;
using DotNetOpenAuth.OAuth2;
using Google.Apis.Bigquery.v2;
using Google.Apis.Bigquery.v2.Data;
using Google.Apis.Util;
namespace BQTry
{
public class BigQueryConsole
{
static string query = "SELECT count(*) FROM [githubarchive:year.2014]";
static string projectId = "some project id";
public static void Main(string[] args)
{
Console.WriteLine("BigQueryAPI STARTINg");
Console.WriteLine("==========================");
String serviceAccountEmail = "someaccount@developer.gserviceaccount.com";
var certificate = new X509Certificate2(@"G:\CW and Research\TERM 2\SM\PROJECT\Code\BQTry\key\somekye.p12", "notasecret", X509KeyStorageFlags.Exportable);
ServiceAccountCredential credential = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(serviceAccountEmail)
{
Scopes = new[] { BigqueryService.Scope.DevstorageReadOnly }
}.FromCertificate(certificate));
// Create the service.
var service = new BigqueryService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "BigQuery API Sample",
});
//Note: all your requests will run against Service.
JobsResource j = service.Jobs;
QueryRequest qr = new QueryRequest();
qr.Query = query;
QueryResponse response = j.Query(qr, projectId).Execute();
}
}
}
无论您做什么,您都需要启用计费,或者从已启用的项目发送凭据 所以,请快速回答您的问题:否。您需要启用计费。但这并不意味着,如果你所做的只是查询公共数据集,你就得付钱
如本页链接文档所示,每月处理的第一TB数据是免费的。谢谢Patrice,因为我无法在未注册的情况下使用我的脚本,我现在已经在Google Big Query上手动运行了几次查询并下载了数据。