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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With