无法通过API

时间:2016-07-01 06:54:16

标签: google-bigquery

我刚刚开始探索BigQuery平台。我已经成功实现了流输入并通过API列出了表中的数据。

现在我正在尝试通过API查询表格,但即使在项目和数据集上具有“所有者”角色,也会出现以下错误。

Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
  "code" : 403,
  "errors" : [ {
    "domain" : "global",
    "message" : "Access Denied: Table eminent-expanse-134408:_f0217d6d035af97e7c4a87ad93962ba4c594717d.anonabb84babe0de5db5b0a1151dfa1857fcea3e92cd: The user abhinandan@eminent-expanse-134408.iam.gserviceaccount.com does not have permission to read data from a table in dataset eminent-expanse-134408:_f0217d6d035af97e7c4a87ad93962ba4c594717d",
    "reason" : "accessDenied"
  } ],
  "message" : "Access Denied: Table eminent-expanse-134408:_f0217d6d035af97e7c4a87ad93962ba4c594717d.anonabb84babe0de5db5b0a1151dfa1857fcea3e92cd: The user abhinandan@eminent-expanse-134408.iam.gserviceaccount.com does not have permission to read data from a table in dataset eminent-expanse-134408:_f0217d6d035af97e7c4a87ad93962ba4c594717d"
}

我缺少什么?我想假装启用账单吗?

1 个答案:

答案 0 :(得分:1)

您好像使用的是服务帐户(abhinandan@eminent-expanse-134408.iam.gserviceaccount.com),而不是您的用户帐户。服务帐户需要是项目的成员或数据集ACL上的(至少一个)读者,以便您能够读取数据。