【问题标题】:Google BigQuery Insert API returning 200 but not inserting dataGoogle BigQuery Insert API 返回 200 但未插入数据
【发布时间】:2016-12-16 12:10:24
【问题描述】:

引用https://cloud.google.com/bigquery/docs/reference/rest/v2/tabledata/insertAll

Google BigQuery API 返回 200,但数据未插入表中;

请求

POST https://www.googleapis.com/bigquery/v2/projects/***/datasets/***/tables/visits/insertAll?fields=insertErrors%2Ckind&key={YOUR_API_KEY}

{
 "rows": [
  {
   "json": {
    "hostId": "Value A",
    "statusCode": "Value B"
   }
  },
  {
  "insertId": "inser-id-yo",
  "json": {
  "hostId": "Value A",
  "statusCode": "Value B"
  }
 }
 ]
}

回应

Response: 200
cache-control:  no-cache, no-store, max-age=0, must-revalidate
content-encoding:  gzip
content-length:  69
content-type:  application/json; charset=UTF-8
date:  Fri, 16 Dec 2016 12:00:16 GMT
etag:  "wWvNncJfeAdSHVaIWRpICxBS7AM/vyGp6PvFo4RvsFtPoIWeCReyIC8"
expires:  Mon, 01 Jan 1990 00:00:00 GMT
pragma:  no-cache
server:  GSE
vary:  Origin, X-Origin

{
 "kind": "bigquery#tableDataInsertAllResponse"
}

但是,我的 BigQuery 表是空的,并且没有插入任何数据。

我知道有许多 SDK,但是我需要能够通过 Curl 来做到这一点,因为我正在使用一种 Google 尚未开发的语言和 SDK。

【问题讨论】:

标签: google-bigquery


【解决方案1】:

遇到此问题的其他人,这是因为 BigQuery 最多可能有两个小时的延迟。

【讨论】:

    【解决方案2】:

    我花了一段时间才找到答案。 一旦我摆脱了 setInsertId(String.valueOf(System.currentTimeMillis())) 行 请看:Data streaming insertAll api usage not equal to actually inserted rows

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-09
      • 1970-01-01
      • 1970-01-01
      • 2020-10-18
      • 2012-09-26
      相关资源
      最近更新 更多