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

Accept insertID for BigQuery API #1066

Closed
wants to merge 4 commits into from
Closed

Accept insertID for BigQuery API #1066

wants to merge 4 commits into from

Conversation

vladmiller
Copy link
Contributor

Sometimes you would like to have control over insertID, in my case for each request I have processedTimestamp which defaults to current timestamp thus making md5 always unique and therefore making insertId inefficient.

Sometimes you would like to have control over insertID, in my case for each request I have *processedTimestamp* which defaults to current timestamp thus making md5 always unique and therefore making insertId inefficient.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Jan 18, 2016
@vladmiller
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Jan 18, 2016
@TrejGun
Copy link

TrejGun commented Jan 18, 2016

👍

@stephenplusplus
Copy link
Contributor

Thanks for this @vladmiller! Did you see #1041? I think we're interested in a solution that allows specifying a raw option, as outlined here: #1041 (comment) -- what are your thoughts on that approach?

@vladmiller
Copy link
Contributor Author

@stephenplusplus It doesn't seems like there are any other fields except insertID, but things could change. I'll see if I can easily implement solution with raw option

@stephenplusplus
Copy link
Contributor

That's true, here's the spec: https://cloud.google.com/bigquery/docs/reference/v2/tabledata/insertAll

  • rows[]
  • rows[].insertId
  • rows[].json
  • skipInvalidRows
  • ignoreUnknownValues
  • templateSuffix

So, maybe the options object should also accept the skipInvalidRows, ignoreUnknownValues, and templateSuffix options:

var opts = {
  raw: true,
  ignoreUnknownValues: true
};

var row = {
  insertId: 'my-id',
  json: {
    // row data
  }
};

table.insert([row, row], opts, function() {});

@vladmiller
Copy link
Contributor Author

@stephenplusplus okay, let's see if it's easy

@stephenplusplus
Copy link
Contributor

Thanks!

@vladmiller
Copy link
Contributor Author

@stephenplusplus pushed new commit with tests and fix. Please check and let me know what you think.

sofisl pushed a commit that referenced this pull request Jan 17, 2023
🤖 I have created a release *beep* *boop*
---


## [3.0.1](googleapis/nodejs-vision@v3.0.0...v3.0.1) (2022-09-21)


### Bug Fixes

* Preserve default values in x-goog-request-params header ([#1044](googleapis/nodejs-vision#1044)) ([a5baeca](googleapis/nodejs-vision@a5baeca))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants