BigQuery的自动化应用脚本不能连接到正确的项目? [英] Automated Apps Script for BigQuery Not Connecting To Right Project?
问题描述
我正在尝试运行查询并在BigQuery中创建表TEST4的应用程序脚本存在以下问题。错误是:
lockquote
找不到项目603804914871,不能用于API调用
(第19行,文件代码)
查询是:
saveQueryToTable(){
var projectId ='fiery-cabinet - ****';
var datasetId ='11234 *** 1';
var tableId ='TEST4';
var job = {
configuration:{
query:{
query:'SELECT *'+
'FROM Test2;',
destinationTable:{
projectId:projectId,
datasetId:datasetId,
tableId:tableId
}
}
}
};
var queryResults = BigQuery.Jobs.insert(job,projectId);
Logger.log(queryResults.status);
}
任何人都可以让我知道我要去哪里吗?
我可以在我的控制台中找到该项目,我可以为该项目启用bigquery API,然后我不会收到任何错误...但它不会运行查询或保存到新表TEST4?
@KENDi的回应是正确的。我必须在Google Developer Console中启用API。
I'm getting the below problem with apps script which is attempting to run a query and create a table, TEST4, in BigQuery. The error is:
"Project 603804914871 is not found and cannot be used for API calls. (line 19, file "Code")"
Query is:
saveQueryToTable() {
var projectId = 'fiery-cabinet-****';
var datasetId = '11234***1';
var tableId = 'TEST4';
var job = {
configuration: {
query: {
query: 'SELECT *' +
'FROM Test2;',
destinationTable: {
projectId: projectId,
datasetId: datasetId,
tableId: tableId
}
}
}
};
var queryResults = BigQuery.Jobs.insert(job, projectId);
Logger.log(queryResults.status);
}
Could anyone let me know where I'm going wrong?
I can find that project in my console, I can enable the bigquery API for that project and then I don't get any errors... however it doesn't run the query or save to a new table "TEST4"?
Response from @KENDi was correct. I had to enable the API in the Google Developer Console.
这篇关于BigQuery的自动化应用脚本不能连接到正确的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!