embulk-output-bigquery 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +2 -0
- data/Rakefile +1 -1
- data/embulk-output-bigquery.gemspec +1 -1
- data/lib/embulk/output/bigquery/bigquery_client.rb +9 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2784d92df0a5542880259e6d0cbdbdf4112576cf
|
4
|
+
data.tar.gz: 8d1a6bd77e56a49f3e303571b48c6b4b5f4f9ec5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5c632416596681d347dcf26da31c0b930930c7cdb60080a1e1e77c590fc8743da5006f3e8b6edc1bccce50c5744872e83f33cb86c66b6b1c0d260747c9b8a09
|
7
|
+
data.tar.gz: 8d5ee5c5f4a63163c7955325aa82d71b9fb497182ce5eb264aa1ff84bf95c156936b860714da2ba1b69e07ffd5cd8b7375f153172f854bb00a1f153b9f0c2bd6
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# embulk-output-bigquery
|
2
2
|
|
3
|
+
[![Build Status](https://secure.travis-ci.org/embulk/embulk-output-bigquery.png?branch=master)](http://travis-ci.org/embulk/embulk-output-bigquery)
|
4
|
+
|
3
5
|
[Embulk](https://github.com/embulk/embulk/) output plugin to load/insert data into [Google BigQuery](https://cloud.google.com/bigquery/) using [direct insert](https://cloud.google.com/bigquery/loading-data-into-bigquery#loaddatapostrequest)
|
4
6
|
|
5
7
|
## Overview
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "embulk-output-bigquery"
|
3
|
-
spec.version = "0.3.
|
3
|
+
spec.version = "0.3.3"
|
4
4
|
spec.authors = ["Satoshi Akama", "Naotoshi Seo"]
|
5
5
|
spec.summary = "Google BigQuery output plugin for Embulk"
|
6
6
|
spec.description = "Embulk plugin that insert records to Google BigQuery."
|
@@ -16,11 +16,6 @@ module Embulk
|
|
16
16
|
@task = task
|
17
17
|
@schema = schema
|
18
18
|
|
19
|
-
@auth_method = task['auth_method']
|
20
|
-
@private_key_path = task['p12_keyfile']
|
21
|
-
@private_key_passphrase = 'notasecret'
|
22
|
-
@json_key = task['json_keyfile']
|
23
|
-
|
24
19
|
@project = task['project']
|
25
20
|
@dataset = task['dataset']
|
26
21
|
|
@@ -40,26 +35,28 @@ module Embulk
|
|
40
35
|
|
41
36
|
scope = "https://www.googleapis.com/auth/bigquery"
|
42
37
|
|
43
|
-
case @auth_method
|
38
|
+
case @task['auth_method']
|
44
39
|
when 'private_key'
|
45
|
-
|
40
|
+
private_key_passphrase = 'notasecret'
|
41
|
+
key = Google::APIClient::KeyUtils.load_from_pkcs12(@task['p12_keyfile'], private_key_passphrase)
|
46
42
|
auth = Signet::OAuth2::Client.new(
|
47
43
|
token_credential_uri: "https://accounts.google.com/o/oauth2/token",
|
48
44
|
audience: "https://accounts.google.com/o/oauth2/token",
|
49
45
|
scope: scope,
|
50
|
-
issuer: @
|
46
|
+
issuer: @task['service_account_email'],
|
51
47
|
signing_key: key)
|
52
48
|
|
53
49
|
when 'compute_engine'
|
54
50
|
auth = Google::Auth::GCECredentials.new
|
55
51
|
|
56
52
|
when 'json_key'
|
57
|
-
|
58
|
-
|
53
|
+
json_key = @task['json_keyfile']
|
54
|
+
if File.exist?(json_key)
|
55
|
+
auth = File.open(json_key) do |f|
|
59
56
|
Google::Auth::ServiceAccountCredentials.make_creds(json_key_io: f, scope: scope)
|
60
57
|
end
|
61
58
|
else
|
62
|
-
key = StringIO.new(
|
59
|
+
key = StringIO.new(json_key)
|
63
60
|
auth = Google::Auth::ServiceAccountCredentials.make_creds(json_key_io: key, scope: scope)
|
64
61
|
end
|
65
62
|
|
@@ -67,7 +64,7 @@ module Embulk
|
|
67
64
|
auth = Google::Auth.get_application_default([scope])
|
68
65
|
|
69
66
|
else
|
70
|
-
raise ConfigError, "Unknown auth method: #{@auth_method}"
|
67
|
+
raise ConfigError, "Unknown auth method: #{@task['auth_method']}"
|
71
68
|
end
|
72
69
|
|
73
70
|
client.authorization = auth
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-bigquery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Satoshi Akama
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-05-
|
12
|
+
date: 2016-05-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-api-client
|