GeezerVison is showing github.com — insertRowsAsStream not showing full error log · Issue #399 · GoogleCloudPlatform/nodejs-docs-samples
insertRowsAsStream not showing full error log #399Labels 🚨This issue needs some love.triage meI really want to be triaged. DescriptionI have tried created a table using the api successfully with 2 fields as nullable.
However I was unable to insertRowsAsStream as using code below
const params = {
datasetId: "Event",
tableId: "navigation9",
projectId: "xxxx-9a8cd",
rows: [
{ Name: "test0", Age: 0 },
{ Name: "test2", Age: 1 },
{ Name: "test3", Age: 2 },
{ Name: "test4", Age: 3 },
{ Name: "test5", Age: 0 }
]
}
insertRowsAsStream(params)
const insertRowsAsStream = ({ datasetId, tableId, rows, projectId }) => new Promise((resolve, reject) => {
const BigQuery = require('@google-cloud/bigquery');
// Instantiates a client
const bigquery = BigQuery({
projectId: projectId
});
console.log('insertRowAsStream rows = ', JSON.stringify(rows, null, 2))
// Inserts data into a table
bigquery
.dataset(datasetId)
.table(tableId)
.insert(rows)
.then((insertErrors) => {
console.log('Inserted:');
rows.forEach((row) => console.log(row));
if (insertErrors && insertErrors.length > 0) {
console.log('Insert errors:');
insertErrors.forEach((err) => console.error(err));
reject('ERROR: ' + JSON.stringify(insertErrors, null, 2));
} else {
resolve('Sucessfully Inserted')
}
})
.catch((err) => {
console.error('ERROR:', err);
reject('ERROR:' + err);
});
// [END bigquery_insert_stream]
});
The log result i got is not very helpful
Inserted:
{ Name: 'test0', Age: 0 }
{ Name: 'test2', Age: 1 }
{ Name: 'test3', Age: 2 }
{ Name: 'test4', Age: 3 }
{ Name: 'test5', Age: 0 }
Insert errors:
{ kind: 'bigquery#tableDataInsertAllResponse' }
Here is do not know what causing the error Activityyrjsg commented on Jun 6, 2017 I've the same issue when run this code in Cloud Function. No errors are returned but no rows are in Bigquery ace-n commented on Jul 11, 2017 @digithunz @frankyaorenjie thanks for reporting this! As of #421, this has been fixed.
MetadataMetadata🚨This issue needs some love.triage meI really want to be triaged. DevelopmentNo branches or pull requestsIssue actions
|