embulk-output-vertica 0.6.1 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e424f0f4739f0888970e5382c396e4b0426fedde
4
- data.tar.gz: c331004b450cff288b720794399954c4aeb22b26
3
+ metadata.gz: eb34c1b088bf2c2f7320d0c6bb1e076b84495683
4
+ data.tar.gz: 300769b3f384905879b654fce8e783b0b85d2262
5
5
  SHA512:
6
- metadata.gz: fff7649f5f618d466c60421b953da6c0576bd672612bad6342cae20f69811cde75a4570c5531a24b80b16ea92f6e5c3ddf47ae905c99aa89f9f7241e32475b5a
7
- data.tar.gz: 4cf68549ba3cae6d3a718bcccc29addc5592f45c0f315e560e9f36314dd6846a0e3a49542c0d31fa1b6d0ee1d46ded6bc3a229a9cf07beb338dd7ade3395956f
6
+ metadata.gz: e94f3b6f86bb97b2dc01862db20113111cb030605996cc10f02c1dacada7bc227a17be8e9589312cb49a916a60a58a15acb42ad40a93a49fa1d5dff7c99d03ec
7
+ data.tar.gz: 98547b91c62437e1a732f72f0dcc35b378ed68d41423c1f6681c3e86acf4cd63be8bd80d24536e35a53de6299c5c2ddc414eba62dfd92f18bde665442a19dc56
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.6.2 (2016/01/28)
2
+
3
+ Enhancements:
4
+
5
+ * Use `CREATE TABLE LIKE` statement to create a temp table to copy nullable or other parameters
6
+
1
7
  # 0.6.1 (2016/01/26)
2
8
 
3
9
  Fixes:
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "embulk-output-vertica"
3
- spec.version = "0.6.1"
3
+ spec.version = "0.6.2"
4
4
  spec.authors = ["eiji.sekiya", "Naotoshi Seo"]
5
5
  spec.email = ["eiji.sekiya.0326@gmail.com", "sonots@gmail.com"]
6
6
  spec.summary = "Vertica output plugin for Embulk"
@@ -78,11 +78,9 @@ module Embulk
78
78
  query(jv, %[CREATE TABLE IF NOT EXISTS #{quoted_schema}.#{quoted_table} (#{sql_schema_table})])
79
79
  end
80
80
 
81
- sql_schema_temp_table = self.sql_schema_from_table(jv, task)
82
-
83
81
  # create a temp table
84
82
  query(jv, %[DROP TABLE IF EXISTS #{quoted_schema}.#{quoted_temp_table}])
85
- query(jv, %[CREATE TABLE #{quoted_schema}.#{quoted_temp_table} (#{sql_schema_temp_table})])
83
+ query(jv, %[CREATE TABLE #{quoted_schema}.#{quoted_temp_table} LIKE #{quoted_schema}.#{quoted_table}])
86
84
  # Create internal vertica projection beforehand, otherwirse, parallel copies lock table to create a projection and we get S Lock error sometimes
87
85
  # This is a trick to create internal vertica projection
88
86
  query(jv, %[INSERT INTO #{quoted_schema}.#{quoted_temp_table} SELECT * FROM #{quoted_schema}.#{quoted_table} LIMIT 0])
@@ -195,18 +193,6 @@ module Embulk
195
193
  end
196
194
  end
197
195
 
198
- def self.sql_schema_from_table(jv, task)
199
- quoted_schema = Jvertica.quote(task['schema'])
200
- quoted_table = Jvertica.quote(task['table'])
201
- sql = "SELECT column_name, data_type FROM v_catalog.columns " \
202
- "WHERE table_schema = #{quoted_schema} AND table_name = #{quoted_table}"
203
-
204
- sql_schema = {}
205
- result = query(jv, sql)
206
- sql_schema = result.map {|row| [row[0], row[1]] }
207
- sql_schema.map {|name, type| "#{::Jvertica.quote_identifier(name)} #{type}" }.join(',')
208
- end
209
-
210
196
  def self.query(conn, sql)
211
197
  Embulk.logger.info "embulk-output-vertica: #{sql}"
212
198
  conn.query(sql)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-vertica
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - eiji.sekiya
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-27 00:00:00.000000000 Z
12
+ date: 2016-01-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jvertica