Ruby 谷歌大查询;所需参数缺失“;红宝石
我正在使用Google的与big query对话,我已将其全部设置好并开始工作,除了出现以下错误的查询:Ruby 谷歌大查询;所需参数缺失“;红宝石,ruby,google-bigquery,Ruby,Google Bigquery,我正在使用Google的与big query对话,我已将其全部设置好并开始工作,除了出现以下错误的查询: {"error"=> {"errors"=> [{"reason"=>"required", "domain"=>"global", "message"=>"Required parameter is missing"}], "code"=>400, "message"=>"Required param
{"error"=>
{"errors"=>
[{"reason"=>"required",
"domain"=>"global",
"message"=>"Required parameter is missing"}],
"code"=>400,
"message"=>"Required parameter is missing"}}
这就是我所说的:
bq = client.discovered_api("bigquery", "v2")
resp = client.execute(
bq.jobs.query,
{ "projectId" => "1234",
"query" => "SELECT count(*) FROM [api_logs.api_logs_week_28__Jul_2012] where timestamp >= 1341817200 and timestamp <= 1341903599"
}
)
bq=client.discovered\u api(“bigquery”、“v2”)
resp=client.execute(
bq.jobs.query,
{“projectId”=>“1234”,
“query”=>“首先从[api_logs.api_logs_week_28_Jul_2012]中选择count(*),其中时间戳>=1341817200,时间戳——我不知道ruby,但我知道bigquery,所以我查看了ruby google drive并尝试对其进行调整:
result = client.execute(
:api_method => bq.jobs.query,
:body_object => { "query" => "SELECT 17" },
:parameters => { "projectId => "1234" })
从本质上讲,projectId需要是一个参数,查询需要在post数据中。令人印象深刻的是,五年后仍在生成一条如此无用的错误消息。谷歌干得不错!