kikinteractive/go-bqstreamer

Name: go-bqstreamer

Owner: Kik Interactive

Description: Stream data into Google BigQuery concurrently using InsertAll()

Created: 2015-03-25 15:48:19.0

Updated: 2018-05-21 07:10:18.0

Pushed: 2017-10-29 10:36:26.0

Homepage:

Size: 100

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Kik and me (@oryband) are no longer maintaining this repository. Thanks for all the contributions. You are welcome to fork and continue development.

BigQuery Streamer BigQuery GoDoc

Stream insert data into BigQuery fast and concurrently, using InsertAll().

Features
Getting Started
  1. Install Go, version should be at least 1.5.
  2. Clone this repository and download dependencies:
  3. Version v2: go get gopkg.in/kikinteractive/go-bqstreamer.v2
  4. Version v1: go get gopkg.in/kikinteractive/go-bqstreamer.v1
  5. Acquire Google OAuth2/JWT credentials, so you can authenticate with BigQuery.
How Does It Work?

There are two types of inserters you can use:

  1. SyncWorker, which is a single blocking (synchronous) worker.
  2. It enqueues rows and performs insert operations in a blocking manner.
  3. AsyncWorkerGroup, which employes multiple background SyncWorkers.
  4. The AsyncWorkerGroup enqueues rows, and its background workers pull and insert in a fan-out model.
  5. An insert operation is executed according to row amount or time thresholds for each background worker.
  6. Errors are reported to an error channel for processing by the user.
  7. This provides a higher insert throughput for larger scale scenarios.
Examples

Check the GoDoc examples section.

Contribute
  1. Please check the issues page.
  2. File new bugs and ask for improvements.
  3. Pull requests welcome!
Test
n unit tests and check coverage.
ke test

n integration tests.
is requires an active project, dataset and pem key.
port BQSTREAMER_PROJECT=my-project
port BQSTREAMER_DATASET=my-dataset
port BQSTREAMER_TABLE=my-table
port BQSTREAMER_KEY=my-key.json
ke testintegration

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.