embulk-output-bigobject 0.3.1 → 0.3.2
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 +4 -4
- data/Rakefile +4 -0
- data/embulk-output-bigobject.gemspec +2 -2
- data/lib/embulk/output/bigobject.rb +12 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 589f01425ae821d10c32d0c4eccbc87f74bed685
|
4
|
+
data.tar.gz: 66e3a2dac27b9d00a37462bd223a488cedda806e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2e32268ab187242cda5e2b69709904bed54fb7f810a9b444543187ef0198838f2341177f79a91f1fec8483daa09297e58b17ca461ab9bb7ef95d5dd75acecc9
|
7
|
+
data.tar.gz: 3454e8932ec72e60abac4372c01590624ec57ae17dd0e2f8a78c302d12feaa69ecc97eb1224e1846727a06e4f3d342ec4c6dbd4af1496dabd11a61e750aa9d0e
|
data/Rakefile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
spec.name = "embulk-output-bigobject"
|
4
|
-
spec.version = "0.3.
|
5
|
-
spec.authors = ["
|
4
|
+
spec.version = "0.3.2"
|
5
|
+
spec.authors = ["Cheng-Ching Huang"]
|
6
6
|
spec.summary = "Bigobject output plugin for Embulk"
|
7
7
|
spec.description = "Dumps records to Bigobject."
|
8
8
|
spec.email = ["cchuang.tw@gmail.com"]
|
@@ -44,7 +44,8 @@ module Embulk
|
|
44
44
|
if response["Status"] == 0 then # the table exists
|
45
45
|
Embulk.logger.debug { "#{response}" }
|
46
46
|
elsif response["Status"] == -11 then # the table does not exist
|
47
|
-
response = rest_exec(task['rest_uri'], "#{create_botable_stmt("#{task['table']}",schema, task['co_map'])}")
|
47
|
+
#response = rest_exec(task['rest_uri'], "#{create_botable_stmt("#{task['table']}",schema, task['co_map'])}")
|
48
|
+
response = rest_exec(task['rest_uri'], "#{create_botable_stmt("#{task['table']}",schema, task["column_options"])}")
|
48
49
|
if response["Status"] != 0 then
|
49
50
|
Embulk.logger.error { "#{response}" }
|
50
51
|
raise "Create table #{task['table']} in BigObject Failed"
|
@@ -149,10 +150,17 @@ module Embulk
|
|
149
150
|
end
|
150
151
|
|
151
152
|
def self.create_botable_stmt(tbl,schema, cos)
|
152
|
-
|
153
|
-
|
153
|
+
val_array = Array.new
|
154
|
+
schema.each do |c|
|
155
|
+
co = cos[c.index] || {}
|
156
|
+
Embulk.logger.debug {"#{c.index}, #{c.name}, #{co}"}
|
157
|
+
val_array.push "#{co["name"] || c.name} #{to_bigobject_column_type(c.type.to_s, c.format.to_s, co)}"
|
158
|
+
end
|
159
|
+
bo_table_schema = val_array.join(',')
|
160
|
+
Embulk.logger.debug {"schema (#{schema.class}): #{schema}"}
|
161
|
+
Embulk.logger.debug {"schema: #{bo_table_schema}"}
|
154
162
|
keys = Array.new
|
155
|
-
cos.each do |
|
163
|
+
cos.each do |co|
|
156
164
|
keys.push co["name"] if co["is_key"]
|
157
165
|
end
|
158
166
|
if keys.length == 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-bigobject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Cheng-Ching Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|