参考https://cloud.google.com/bigquery/docs/reference/rest/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,但是我需要能够通过卷曲来做到这一点,因为我正在使用Google尚未开发和SDK的语言。
其他遇到此问题的人,因为BigQuery可以延迟两个小时。
我花了一段时间才找到答案。一旦我摆脱了setInsertid(string.valueof(system.currenttimemillis())))请参阅:数据流插入API使用不等于实际插入行