embulk-input-big-query-async 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d734bb0199f3990a133a282ad92078c5dfc62be59985605a9a475fdb8f9b0011
|
4
|
+
data.tar.gz: f84976f7a86426a774493c5707cb9d6fd1c1fe75f9d117b745229d61953bb4e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
8
|
+
Plugin.register_input('big-query-async', self)
|
9
9
|
|
10
|
-
|
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
|
38
|
+
keyfile: config.param(:keyfile, LocalFile, nil),,
|
27
39
|
sql: sql,
|
28
40
|
columns: config[:columns],
|
29
41
|
params: params,
|
Binary file
|