embulk-input-big-query-async 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac3f8f559edb9513bcccc8ce66c5affe2fc12f9a5a5d5ba5338132adc5888a39
4
- data.tar.gz: 9900364c848cfc65ab69093babebaf1500648dd2d1d1ad3af056562e5fe7d93f
3
+ metadata.gz: d734bb0199f3990a133a282ad92078c5dfc62be59985605a9a475fdb8f9b0011
4
+ data.tar.gz: f84976f7a86426a774493c5707cb9d6fd1c1fe75f9d117b745229d61953bb4e0
5
5
  SHA512:
6
- metadata.gz: dd545e000af5ed8d207288f633bb93fffac98e57d1653476499b6071c70cd3592c533691f5dabc35b3e7a04852cd6b9a1001a07217f9f3d90832504f8095931d
7
- data.tar.gz: b0ff305fb6d724725a4192c3f6684c255231eada84a31dfbf41c9d0e0f7b294964d84b1a61ac6d8d6f5201e2ad7af5b37c4c675a38c41ea8ed220ad1e5e9ec5a
6
+ metadata.gz: cf65539b0594c751a42e4b7da02a1228c94e451fbbd03a5fa37195af90edc7018596325071a0f8748f221ec64ff349bb00685acc58b73a25ded124d3f7ae7759
7
+ data.tar.gz: c466326e4fdcbb87b5ad8c7f4e5336533a7843a230a4e3f8eebaed24bd85cfff84412242ca1aa1365c234197cb39af002d711c56585475471c49f03f0ad0774b
@@ -5,9 +5,21 @@ require 'erb'
5
5
  module Embulk
6
6
  module Input
7
7
  class InputBigquery < InputPlugin
8
- Plugin.register_input('big-query-async', self)
8
+ Plugin.register_input('big-query-async', self)
9
9
 
10
- def self.transaction(config, &control)
10
+ # support config by file path or content which supported by org.embulk.spi.unit.LocalFile
11
+ # keyfile:
12
+ # content: |
13
+ class LocalFile
14
+ def self.load(v)
15
+ if v.is_a?(String)
16
+ v
17
+ elsif v.is_a?(Hash)
18
+ JSON.parse(v['content'])
19
+ end
20
+ end
21
+ end
22
+ def self.transaction(config, &control)
11
23
  sql = config[:sql]
12
24
  params = {}
13
25
  unless sql
@@ -23,7 +35,7 @@ module Embulk
23
35
 
24
36
  task = {
25
37
  project: config[:project],
26
- keyfile: config[:keyfile],
38
+ keyfile: config.param(:keyfile, LocalFile, nil),,
27
39
  sql: sql,
28
40
  columns: config[:columns],
29
41
  params: params,
@@ -1,7 +1,7 @@
1
1
  module Embulk
2
2
  module Input
3
3
  module Bigqueryasync
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-big-query-async
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angelos Alexopoulos