embulk-output-bigobject 0.4.5 → 0.4.6

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
  SHA1:
3
- metadata.gz: ef8bcb1f718af068fbd06212695421ebf7dc0f1b
4
- data.tar.gz: 06ab30a8366d909fb00850560d328ee1e1125be9
3
+ metadata.gz: 7d76075ba278dfd4c68f1def6274f45fff253f33
4
+ data.tar.gz: be5f7ec79358d9dc14f16f10ab26189c5e60f49b
5
5
  SHA512:
6
- metadata.gz: c4cb6ceddd4c48afc581b4891f0c35a4101926fdb01170bdab38c96c320cb35585b064dd626883d2ff8a8a86a042df9c04231534e82e433d09c1d307681ddecd
7
- data.tar.gz: 906155307452bc5765ade2e6db67afe2bc37802062b47e785ba7d8530d83ba901d182ce9979a40b2d8b03ae49f8b6ab1fb93bbcfe124b041e72e5421af824e45
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.5"
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
- schema.each do |c|
161
- co = cos[c.index] || {}
162
- Embulk.logger.debug {"#{c.index}, #{c.name}, #{co}"}
163
- val_array.push "#{co["name"] || c.name} #{to_bigobject_column_type(c.type.to_s, c.format.to_s, co)}"
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}"}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-bigobject
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cheng-Ching Huang