【发布时间】:2018-08-22 16:30:07
【问题描述】:
我用的是官方Google Node connector to BigQuery。
我有以下 sn-p 将记录流式传输到数据库中:
module.exports.sendToBigQuery = (rows) => {
bigquery
.dataset(DATASET_NAME)
.table(TABLE_NAME)
.insert(rows)
.catch(err => {
if (err && err.name === 'PartialFailureError') {
if (err.errors && err.errors.length > 0) {
console.log('Insert errors:');
err.errors.forEach(err => console.error(err));
}
} else {
console.error('ERROR:', err);
}
});
};
不幸的是,每当我的数据与 scema 不匹配时,我得到的只是这个神秘的错误对象:
{ errors: [ { message: 'no such field.', reason: 'invalid' } ],
没有location 字段可以告诉我缺少哪个字段,这使得调试此代码成为更复杂架构的噩梦。
有没有办法以某种方式启用调试级别的错误?或者它只是客户端实现中的一个错误?知道如何访问这些信息吗?
【问题讨论】:
标签: node.js google-cloud-platform google-bigquery