Reputation: 41
function appendJoin12() {
var datasetId = 'Join_Test';
var tableId = 'Join12';
var job =
{
configuration:
{
query:
{
query: 'SELECT * FROM [instagram-1314:Join_Test.Join1],
writeDisposition:'WRITE_TRUNCATE',
destinationTable:
{
projectId: 'instagram-1314',
datasetId: 'Join_Test',
tableId: tableId
}
}
}
};
var queryResults = BigQuery.Jobs.insert(job, "instagram-1314");
var jobId = queryResults.jobReference.jobId;
while (!queryResults.jobComplete) {
Utilities.sleep(1000);
queryResults = BigQuery.Jobs.getQueryResults("instagram-1314", jobId);
}
Logger.log(queryResults.status);
};
when I am running the above code I am getting an error -
Encountered an error while globbing file pattern.
I enabled BigQuery Api in google developer console and also in advanced google services(App Script). Do I need to enable any other API's
Can anyone please help me out with this.
Upvotes: 0
Views: 373
Reputation: 418
I think you simply forgot to close the quotes on line 12. Wasn't it? otherwise it looks just like the reference
function appendJoin12() {
var datasetId = 'Join_Test';
var tableId = 'Join12';
var job =
{
configuration:
{
query:
{
query: 'SELECT * FROM [instagram-1314:Join_Test.Join1]',
writeDisposition:'WRITE_TRUNCATE',
destinationTable:
{
projectId: 'instagram-1314',
datasetId: 'Join_Test',
tableId: tableId
}
}
}
};
var queryResults = BigQuery.Jobs.insert(job, "instagram-1314");
var jobId = queryResults.jobReference.jobId;
while (!queryResults.jobComplete) {
Utilities.sleep(1000);
queryResults = BigQuery.Jobs.getQueryResults("instagram-1314", jobId);
}
Logger.log(queryResults.status);
nce in the documentation
Upvotes: 1