使用BigQuery Jobs API复制多个BigQuery表

时间:2014-08-05 12:37:43

标签: google-bigquery

我在BigQuery Jobs API中注意到了Copy任务:

https://developers.google.com/bigquery/docs/reference/v2/jobs#resource

存在" sourceTables"的输入:

"copy": {
  "sourceTables": [
    {
      "projectId": string,
      "datasetId": string,
      "tableId": string
    }
  ],

但是我们只能定义一个单一的" destinationTable"而不是" destinationTables":

  "destinationTable": {
    "projectId": string,
    "datasetId": string,
    "tableId": string
  },

有没有办法可以使用上面的API将多个源表从一个数据集复制到另一个数据集?

1 个答案:

答案 0 :(得分:3)

要创建多个目标表,您需要运行多个作业。如果您想一次性完成这些操作,可以使用批量请求(HTTP API的文档here。Python文档是here,Java here