Skip to content
This repository has been archived by the owner on Jun 12, 2019. It is now read-only.

Support insertId and other optional params in Tabledata.insertAll #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

nashyeung
Copy link

@nashyeung nashyeung commented Mar 10, 2016

In my use case, I use BigQuery::Client::Tables.insert with large arrays frequently.
Sometimes they succeed partially, i.e. half rows of a batch are added, the other half fail.

Instead of checking the results and only resending the failed rows (so the good rows are not sent twice), I want to add insertId to each row, then let Google do the de-duplication for us.

This is the main purpose of this PR.

It's quite hard to add insertId support to the existing insert() method without changing its interface, so I create a new insert_all().

kysnm added a commit to kysnm/BigQuery that referenced this pull request Apr 20, 2016
@kysnm kysnm mentioned this pull request Apr 20, 2016
In VCR, empty response body may be converted to an empty string, which
raises error when we call resp.to_h.

Check the response for nil and empty string, and converts it to an empty
hash manually.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants