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 +4 -4
- data/CHANGELOG.md +6 -0
- data/embulk-output-vertica.gemspec +1 -1
- data/lib/embulk/output/vertica.rb +1 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb34c1b088bf2c2f7320d0c6bb1e076b84495683
|
4
|
+
data.tar.gz: 300769b3f384905879b654fce8e783b0b85d2262
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e94f3b6f86bb97b2dc01862db20113111cb030605996cc10f02c1dacada7bc227a17be8e9589312cb49a916a60a58a15acb42ad40a93a49fa1d5dff7c99d03ec
|
7
|
+
data.tar.gz: 98547b91c62437e1a732f72f0dcc35b378ed68d41423c1f6681c3e86acf4cd63be8bd80d24536e35a53de6299c5c2ddc414eba62dfd92f18bde665442a19dc56
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "embulk-output-vertica"
|
3
|
-
spec.version = "0.6.
|
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}
|
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.
|
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-
|
12
|
+
date: 2016-01-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jvertica
|