2012-07-11 133 views
0

我使用谷歌的ruby api client去跟大的查詢和我擁有一切設置和工作,除了在那裏我得到這個錯誤的查詢:「缺少參數」紅寶石寶石谷歌大查詢

{"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" 
    } 
) 

令人沮喪的部分是在query api docs,這些相同的確切參數工作得很好。有任何想法嗎?

+0

令人印象深刻的是,這個無用的錯誤信息在五年後仍在生產中。不錯的作品谷歌! – 2016-04-09 23:43:16

回答

0

第一 - - 我不知道紅寶石,但我知道的BigQuery,所以我採取了看看紅寶石谷歌驅動example並努力去適應它:

result = client.execute(
    :api_method => bq.jobs.query, 
    :body_object => { "query" => "SELECT 17" }, 
    :parameters => { "projectId => "1234" }) 

本質的專案編號需求作爲參數,並且查詢需要在發佈數據中。