Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insertRowsAsStream not showing full error log #399

Closed
luna-ci opened this issue Jun 1, 2017 · 2 comments
Closed

insertRowsAsStream not showing full error log #399

luna-ci opened this issue Jun 1, 2017 · 2 comments
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@luna-ci
Copy link

luna-ci commented Jun 1, 2017

I 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

@jmdobry jmdobry added the bug label Jun 1, 2017
@frankyaorenjie
Copy link

I've the same issue when run this code in Cloud Function. No errors are returned but no rows are in Bigquery

@ace-n
Copy link
Contributor

ace-n commented Jul 11, 2017

@digithunz @frankyaorenjie thanks for reporting this! As of #421, this has been fixed.

@ace-n ace-n closed this as completed Jul 11, 2017
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
grayside pushed a commit that referenced this issue Nov 16, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ace-n pushed a commit that referenced this issue Nov 17, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ace-n pushed a commit that referenced this issue Nov 17, 2022
grayside pushed a commit that referenced this issue Nov 17, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ace-n pushed a commit that referenced this issue Nov 17, 2022
ace-n pushed a commit that referenced this issue Nov 17, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ahrarmonsur pushed a commit that referenced this issue Nov 17, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ace-n pushed a commit that referenced this issue Nov 17, 2022
ace-n pushed a commit that referenced this issue Nov 17, 2022
ace-n pushed a commit that referenced this issue Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

5 participants