embulk-output-vertica 0.7.0 → 0.7.1

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: e728473aef9d73c5ff031ba16f354129fce903ac
4
- data.tar.gz: 701b369758f736ca57455e4ba15d395ece62669f
3
+ metadata.gz: 5378b73846425007a9de7f30869bfd2206b06bed
4
+ data.tar.gz: cc430ff8ec752696eec4933fdc982832bf179133
5
5
  SHA512:
6
- metadata.gz: 5e7ca636569766779460699fbec289c9f6c246c8a35d85ed3764a8f0e7af6c3453c4a32771fcf81313217ab2867d06326026aa86ff61e721f60fc0d224717891
7
- data.tar.gz: 873396d69807a19426a8ec5d088d86c8a081b3e381e283298d4952615963598fd1d33acd96605f4775d2fa4c028dc586d535838915db6df5493eaabc32c9365f
6
+ metadata.gz: 7c599fac58e80276b4f8a312bb962b6281f2e95752197a429a3f5b05d9b71e131037ad653f5556a5939bb6cfa7f008b91a700e89d9345d54d8c185fa98e3b5dc
7
+ data.tar.gz: 25a0159744f47d3e4e0343673ba940f816335b1fae2a9bbbd84afec0d7d45daf06cc8d19edb7b453a3a5c477ecdd3cb92b136f6d7ad6aed6b9ffc93d98d8e935
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.7.1 (2016/01/30)
2
+
3
+ Enhancements:
4
+
5
+ * Create table with INCLUDING PROJECTIONS on mode `REPLACE`
6
+
1
7
  # 0.7.0 (2016/01/29)
2
8
 
3
9
  Breaking Changes:
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "embulk-output-vertica"
3
- spec.version = "0.7.0"
3
+ spec.version = "0.7.1"
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"
@@ -80,10 +80,16 @@ module Embulk
80
80
 
81
81
  # create a temp table
82
82
  query(jv, %[DROP TABLE IF EXISTS #{quoted_schema}.#{quoted_temp_table}])
83
- query(jv, %[CREATE TABLE #{quoted_schema}.#{quoted_temp_table} LIKE #{quoted_schema}.#{quoted_table}])
84
- # Create internal vertica projection beforehand, otherwirse, parallel copies lock table to create a projection and we get S Lock error sometimes
85
- # This is a trick to create internal vertica projection
86
- query(jv, %[INSERT INTO #{quoted_schema}.#{quoted_temp_table} SELECT * FROM #{quoted_schema}.#{quoted_table} LIMIT 0])
83
+
84
+ if task['mode'] == 'REPLACE'
85
+ # In the case of replace mode, this temp table is replaced with the original table. So, projections should also be copied
86
+ query(jv, %[CREATE TABLE #{quoted_schema}.#{quoted_temp_table} LIKE #{quoted_schema}.#{quoted_table} INCLUDING PROJECTIONS])
87
+ else
88
+ query(jv, %[CREATE TABLE #{quoted_schema}.#{quoted_temp_table} LIKE #{quoted_schema}.#{quoted_table}])
89
+ # Create internal vertica projection beforehand, otherwirse, parallel copies lock table to create a projection and we get S Lock error sometimes
90
+ # This is a trick to create internal vertica projection
91
+ query(jv, %[INSERT INTO #{quoted_schema}.#{quoted_temp_table} SELECT * FROM #{quoted_schema}.#{quoted_table} LIMIT 0])
92
+ end
87
93
  Embulk.logger.trace {
88
94
  result = query(jv, %[SELECT EXPORT_OBJECTS('', '#{task['schema']}.#{task['temp_table']}')])
89
95
  # You can see `CREATE PROJECTION` if the table has a projection
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.7.0
4
+ version: 0.7.1
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-29 00:00:00.000000000 Z
12
+ date: 2016-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jvertica