Open
Description
async function insertRowsAsStream(datasetId, tableId, rows) {
const bigqueryClient = new BigQuery();
// Insert data into a table
try {
const result = await new Promise((resolve, reject) => {
bigqueryClient
.dataset(datasetId)
.table(tableId)
.insert(rows)
.then((results) => {
console.log(Inserted ${rows.length} rows into ${tableId} for dataset ${datasetId}
);
resolve(rows);
})
.catch((err) => {
reject(err);
});
});
} catch (error) {
console.log("----BQ JSON Error --- \n ", JSON.stringify(error), "\n");
throw new Error(error);
}
}
console.log("----BQ JSON Error --- \n ", JSON.stringify(error), "\n"); this line create an error
Metadata
Metadata
Assignees
Labels
No labels
Activity