0
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);   

};

当我运行上面的代码时,我收到一个错误 -

通配文件模式时遇到错误

我在谷歌开发者控制台和高级谷歌服务(应用脚本)中启用了 BigQuery Api。我是否需要启用任何其他 API

谁能帮我解决这个问题。

4

1 回答 1

1

我认为您只是忘记关闭第 12 行的引号。不是吗?否则它看起来就像参考

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);   

在文档中

于 2016-09-23T08:46:15.827 回答