【发布时间】:2014-06-30 00:05:55
【问题描述】:
一直在为此苦苦挣扎...... Google Apps 脚本和 Big Query API 运行良好,但是当我尝试使用 BigQuery.Tabledata.insertAll 时,我不断收到一条错误消息,提示“没有此类字段”。
当我尝试通过 Google API 资源管理器运行相同的东西时,它运行良好。文档说命令是:
BigQuery.TableData.insertAll(TableDataInsertAllRequest resource, String projectId, String datasetId, String tableId)
我已经按照文档https://developers.google.com/bigquery/docs/reference/v2/tabledata/insertAll 构建了 TableDataInsertAllRequest 资源,它看起来像这样:
{
"kind": "bigquery#tableDataInsertAllRequest",
"rows":
[
{
"json":
{
"domain": "test",
"kind": "another test"
}
}
]
}
这与我的表架构匹配。
当我运行命令时返回的错误是:
{
"insertErrors": [
{
"index": 0,
"errors": [
{
"message": "no such field",
"reason": "invalid"
}
]
}
],
"kind": "bigquery#tableDataInsertAllResponse"
}
正如我所说,相同的 TableDataInsertAllRequest 资源在 API 资源管理器中可以正常工作(单击上面文档页面上的 Try It),但它不能通过 Apps 脚本工作。
感谢您的帮助。
【问题讨论】:
-
请发布您的架构和失败的作业 ID。
-
你让这件事工作了吗?愿意发布您的答案吗?谢谢!
标签: google-apps-script google-api google-bigquery