【发布时间】: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。
【问题讨论】:
-
如何检查数据是否在表中?请注意,流式插入最长可能需要 90 分钟才能用于复制和导出操作 (cloud.google.com/bigquery/streaming-data-into-bigquery),因此如果您要导出表,则可能会出现延迟。
-
谢谢@VictorMota
标签: google-bigquery