3
votes

I noticed in BigQuery Jobs API for the Copy task:

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

there exists a input for "sourceTables":

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

However we can only define a singular "destinationTable" rather than "destinationTables":

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

Is there a way I can use the above API to copy multiple source tables from one Dataset into another Dataset?

1

1 Answers

3
votes

To create multiple destination tables you'll need to run multiple jobs. If you want to do these all at once, you can use a batch request (docs for the HTTP API here. Python docs are here, and Java here.