Google bigquery 使用RESTAPI创建表时,需要多长时间才能使用它?
我正在使用curl成功创建表:Google bigquery 使用RESTAPI创建表时,需要多长时间才能使用它?,google-bigquery,Google Bigquery,我正在使用curl成功创建表: $ curl https://www.googleapis.com/bigquery/v2/projects/s2g-bd1-001/datasets/integration_tests/tables?key=$BQKEY -H 'Authorization: Bearer '$BQAUTH -H 'Content-Type: application/json' -d '{"kind": "bigquery#table", "tableReference": {"
$ curl https://www.googleapis.com/bigquery/v2/projects/s2g-bd1-001/datasets/integration_tests/tables?key=$BQKEY -H 'Authorization: Bearer '$BQAUTH -H 'Content-Type: application/json' -d '{"kind": "bigquery#table", "tableReference": {"projectId": "s2g-bd1-001", "datasetId": "integration_tests", "tableId": "0479414158500731"}, "friendlyName": "afriendlyname", "description": "afriendlydescription", "schema": {"fields": [{"name": "field1", "type": "STRING"} ] } }'
{
"kind": "bigquery#table",
"etag": "\"p8M0C9D2VWWNeiiBOvzKozM5ryM/W3ReJVrhvIimKGxRGXUdDJZI93w\"",
"id": "s2g-bd1-001:integration_tests.0479414158500731",
"selfLink": "https://www.googleapis.com/bigquery/v2/projects/s2g-bd1-001/datasets/integration_tests/tables/0479414158500731",
"tableReference": {
"projectId": "s2g-bd1-001",
"datasetId": "integration_tests",
"tableId": "0479414158500731"
},
"friendlyName": "afriendlyname",
"description": "afriendlydescription",
"schema": {
"fields": [
{
"name": "field1",
"type": "STRING"
}
]
},
"creationTime": "1403588096488",
"lastModifiedTime": "1403588096488"
}
但后来我得到一个404试图把它拿回来
$ curl https://www.googleapis.com/bigquery/v2/projects/s2g-bd1-001/datasets/integration_tests/tables/0479414158500731?key=$BQKEY -H 'Authorization: Bearer '$BQAUTH
{
"error": {
"errors": [ {
"domain": "global",
"reason": "notFound",
"message": "Not Found: Table s2g-bd1-001:integration_tests.0479414158500731"
} ],
"code": 404,
"message": "Not Found: Table s2g-bd1-001:integration_tests.0479414158500731"
}
}
当然,创建该表是因为另一个post调用返回409:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "duplicate",
"message": "Already Exists: Table s2g-bd1-001:integration_tests.0479414158500731"
}
],
"code": 409,
"message": "Already Exists: Table s2g-bd1-001:integration_tests.0479414158500731"
}
}
我能够创建一些这样的表格,并且能够看到它们,但是突然间这些表格就不再具体化了,即使这篇文章成功了。我应该补充一点,我能够通过web控制台成功地创建表
怎么回事 当您收到创建表的响应时,它将同步创建。这意味着一旦你收到你的回应,你应该能够立即与之互动。您可以通过响应中的creationTime字段看到这一点 我不确定您为什么会收到get方法的404。也许可以添加一些try逻辑,然后在中间等待一两秒钟。响应是表资源,因此您也可以使用它,而不是再次检索它 附言:你在发帖的时候有没有把卷发里的帖子漏掉