-
Notifications
You must be signed in to change notification settings - Fork 641
Closed
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.
Description
In the BigQuery Docs' REST reference, for a copy job, one may specify a single sourceTable object, or a list of tables as sourceTables. It looks like it's currently not possible to specify sourceTables using the NodeAPI's copy method. Instead, we have to post a much more verbose REST request like:
const copyJob = await new Promise((resolve, reject) => {
bigQuery.request({
method: 'POST',
uri: '/jobs',
json: {
configuration: {
copy: {
sourceTables,
destinationTable: {
datasetId: table.dataset.id,
projectId: table.bigQuery.projectId,
tableId: table.id,
},
writeDisposition: overwrite ? 'WRITE_TRUNCATE' : 'WRITE_APPEND',
},
},
},
}, (err, resp) => {
if (err) {
return reject(err);
}
const job = bigQuery.job(resp.jobReference.jobId);
job.metadata = resp;
resolve(job);
});
});
I'd like to request a feature on the Node API's copy function that allows us to specify multiple source tables ala sourceTables. Cheers!
Environment details
- OS: MacOs Sierra v. 10.12.4
- Node.js version: 7.7.3
- npm version: 4.1.2
- google-cloud/storage: 1.1.0
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.