Tag: google bigquery

如何使用gcloud在bigquery中上传到几个表

有没有办法上传不同的数据到一个加载作业使用nodejs gcloud库bigquery或使用bq命令行中的几个表?

BigQuery读取ECONNRESET

将Firebase云端函数与Google BigQuery结合使用时。 有时这个函数被触发时会随机抛出一个错误。 这是我们的错误日志: Error: read ECONNRESET at exports._errnoException (util.js:1026:11) at TLSWrap.onread (net.js:569:26) 这里是我的同事的代码。 const bigQuery = require('@google-cloud/bigquery'); const admin = require('firebase-admin'); const database = admin.database(); exports.updateAllPlaceStatistics = (request, response) => { const secret = request.query['secret']; if (secret !== 'secret') { return response.json({message: 'Request failed!'}); } const big = bigQuery(); return big.query({ query: [ 'SELECT […]

是一个服务帐户在node.js中查询google bigquery的正确凭据?

我在Google API Console中创build了一个服务帐户,下载了.p12文件,现在我正在尝试使用https://github.com/hokaccha/node-jwt-simple来为令牌签名。 在哪里/如何获得用HS256签名的“秘密”?

如何使用nodejs使用缓冲区创build一个readstream

我有这个json: var myJSON = '{"kind": "person", "fullName": "Rivka3"}'; 我试图将其上传到bigquery,使用createReadStream。 当我保存它当地我成功: fs.writeFile("/tmp/bq_json_file_new.json", myJSON, function(err){}); fs.createReadStream("/tmp/bq_json_file_new.json") .pipe(table.createWriteStream(metadata)) .on('complete', function(job) { job .on('error', console.log) .on('complete', function(metadata) { console.log('job completed', metadata); }); }); 现在我试图做到这一点,而不是保存它本地 – 使用缓冲区: fs.createReadStream(new Buffer(myJSON, "utf8")) .pipe(table.createWriteStream(metadata)) .on('complete', function(job) { job .on('error', console.log) .on('complete', function(metadata) { console.log('job completed', metadata); }); }); 但我收到这个错误: fs.js:575 binding.open(pathModule._makeLong(path), TypeError: path […]