embulk-output-bigobject 0.4.5 → 0.4.6
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/embulk-output-bigobject.gemspec +1 -1
- data/lib/embulk/output/bigobject.rb +13 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d76075ba278dfd4c68f1def6274f45fff253f33
|
4
|
+
data.tar.gz: be5f7ec79358d9dc14f16f10ab26189c5e60f49b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c761a22c1ca51afa2158748a5eae2ba73bb4ef08938193d8b4ea961686ec595062a4a93b80155a884713a058e7d8c919804c7e8292fbbd62874950beeb6d221
|
7
|
+
data.tar.gz: 0f2b7844702624bf15669232428444824330fcc5ca56b6f19983dc19d2fe1988907846d003d8c28f372c75750c54090633eef556343249909f30d20c9f6213ca
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
spec.name = "embulk-output-bigobject"
|
4
|
-
spec.version = "0.4.
|
4
|
+
spec.version = "0.4.6"
|
5
5
|
spec.authors = ["Cheng-Ching Huang"]
|
6
6
|
spec.summary = "Bigobject output plugin for Embulk"
|
7
7
|
spec.description = "Dumps records to Bigobject."
|
@@ -46,7 +46,7 @@ module Embulk
|
|
46
46
|
if response["Status"] == 0 then # the table exists
|
47
47
|
Embulk.logger.debug { "#{response}" }
|
48
48
|
elsif response["Status"] == -11 then # the table does not exist
|
49
|
-
response = rest_exec(task['rest_uri'], "#{create_botable_stmt("#{task['table']}", "#{task['rowcolumn']}", schema, task["column_options"])}")
|
49
|
+
response = rest_exec(task['rest_uri'], "#{create_botable_stmt("#{task['table']}", "#{task['rowcolumn']}", schema, task["column_options"], !(task['payload_column_index'].nil?))}")
|
50
50
|
if response["Status"] != 0 then
|
51
51
|
Embulk.logger.error { "#{response}" }
|
52
52
|
raise "Create table #{task['table']} in BigObject Failed"
|
@@ -106,7 +106,6 @@ module Embulk
|
|
106
106
|
if pindex
|
107
107
|
page.each do |record|
|
108
108
|
data.push "#{record[pindex]}\n"
|
109
|
-
Embulk.logger.debug "#{record[pindex]}\n"
|
110
109
|
end
|
111
110
|
else
|
112
111
|
page.each do |record|
|
@@ -155,12 +154,19 @@ module Embulk
|
|
155
154
|
end
|
156
155
|
end
|
157
156
|
|
158
|
-
def self.create_botable_stmt(tbl,rowcol,schema, cos)
|
157
|
+
def self.create_botable_stmt(tbl,rowcol,schema, cos, is_payload)
|
159
158
|
val_array = Array.new
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
159
|
+
if is_payload
|
160
|
+
cos.each do |co|
|
161
|
+
Embulk.logger.debug {"#{co}"}
|
162
|
+
val_array.push "#{co["name"]} #{co["type"]}"
|
163
|
+
end
|
164
|
+
else
|
165
|
+
schema.each do |c|
|
166
|
+
co = cos[c.index] || {}
|
167
|
+
Embulk.logger.debug {"#{c.index}, #{c.name}, #{co}"}
|
168
|
+
val_array.push "#{co["name"] || c.name} #{to_bigobject_column_type(c.type.to_s, c.format.to_s, co)}"
|
169
|
+
end
|
164
170
|
end
|
165
171
|
bo_table_schema = val_array.join(',')
|
166
172
|
#Embulk.logger.debug {"schema (#{schema.class}): #{schema}"}
|