embulk-output-vertica 0.2.3 → 0.2.4

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: 2ab7bcf92a11a6a2899ca833c6a8c07677d5b1e5
4
- data.tar.gz: d05503ff66756df167a83e70da5ca7cd6f7ba2f0
3
+ metadata.gz: 48c16a813edf8f1379f84b3f26dd60003cf2d31e
4
+ data.tar.gz: 037817f190e9cda6fee9616ebd7609f646b6ada1
5
5
  SHA512:
6
- metadata.gz: 2c2dd21ae409cbcfcf40428bdcc6e2ad67f9911935145d69f05a7b534546523ae4618e879f60b6ca7a60ada7496ee9754da5f909b7b50773a8474c52a5f08787
7
- data.tar.gz: e3e962118458e4412370e5efa25227f801d5986a4bced0f29a67ab490608d2e83f15d3a9e3c1ea769530cabc7006019b4f16b935819dbf560d32ac899322b9ca
6
+ metadata.gz: e22a0facffaaa48bf6f342cacfec900a76addc3260159bc8fd354a7feeaa3cf40031c94a6d64c281418cbe0b441e58a788e5be69c99dcf584ea45b6855e3ed37
7
+ data.tar.gz: 479dbb5a7edbc543c74616e87c679c55d66364e7092d0a024e18003d23a9033092aaf7baba5bef5ac7c893d1542fee2e684a26ca44b895bbab70fbb55d84807c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 0.2.4 (2015/10/23)
2
+
3
+ Changes:
4
+
5
+ * Rename `username` to `user` to be compatible with ruby vertica gem and jruby jvertica gem
6
+ * still, support `username` for backward compatibility
7
+
1
8
  # 0.2.3 (2015/09/16)
2
9
 
3
10
  Changes:
data/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  - **host**: hostname (string, default: localhost)
13
13
  - **port**: port number (integer, default: 5433)
14
- - **username**: username (string, required)
14
+ - **user**: user name (string, required)
15
15
  - **password**: password (string, default: '')
16
16
  - **database**: database name (string, default: vdb)
17
17
  - **schema**: schema name (string, default: public)
@@ -52,7 +52,7 @@
52
52
  out:
53
53
  type: vertica
54
54
  host: 127.0.0.1
55
- username: dbadmin
55
+ user: dbadmin
56
56
  password: xxxxxxx
57
57
  database: vdb
58
58
  schema: sandbox
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "embulk-output-vertica"
3
- spec.version = "0.2.3"
3
+ spec.version = "0.2.4"
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"
data/example.yml CHANGED
@@ -26,7 +26,7 @@ in:
26
26
  out:
27
27
  type: vertica
28
28
  host: 127.0.0.1
29
- username: dbadmin
29
+ user: dbadmin
30
30
  password: xxxxxxx
31
31
  database: vdb
32
32
  schema: sandbox
@@ -13,7 +13,8 @@ module Embulk
13
13
  task = {
14
14
  'host' => config.param('host', :string, :default => 'localhost'),
15
15
  'port' => config.param('port', :integer, :default => 5433),
16
- 'username' => config.param('username', :string),
16
+ 'user' => config.param('user', :string, :default => nil),
17
+ 'username' => config.param('username', :string, :default => nil), # alias to :user for backward compatibility
17
18
  'password' => config.param('password', :string, :default => ''),
18
19
  'database' => config.param('database', :string, :default => 'vdb'),
19
20
  'schema' => config.param('schema', :string, :default => 'public'),
@@ -26,12 +27,17 @@ module Embulk
26
27
  'reject_on_materialized_type_error' => config.param('reject_on_materialized_type_error', :bool, :default => false),
27
28
  }
28
29
 
30
+ task['user'] ||= task['username']
31
+ unless task['user']
32
+ raise ConfigError.new 'required field "user" is not set'
33
+ end
34
+
29
35
  unless %w[INSERT REPLACE].include?(task['mode'].upcase!)
30
- raise ConfigError, "`mode` must be one of INSERT, REPLACE"
36
+ raise ConfigError.new "`mode` must be one of INSERT, REPLACE"
31
37
  end
32
38
 
33
39
  unless %w[AUTO DIRECT TRICKLE].include?(task['copy_mode'].upcase!)
34
- raise ConfigError, "`copy_mode` must be one of AUTO, DIRECT, TRICKLE"
40
+ raise ConfigError.new "`copy_mode` must be one of AUTO, DIRECT, TRICKLE"
35
41
  end
36
42
 
37
43
  now = Time.now
@@ -133,7 +139,7 @@ module Embulk
133
139
  jv = ::Jvertica.connect({
134
140
  host: task['host'],
135
141
  port: task['port'],
136
- user: task['username'],
142
+ user: task['user'],
137
143
  password: task['password'],
138
144
  database: task['database'],
139
145
  })
@@ -167,7 +173,7 @@ module Embulk
167
173
  when :boolean then 'BOOLEAN'
168
174
  when :long then 'INT' # BIGINT is a synonym for INT in vertica
169
175
  when :double then 'FLOAT' # DOUBLE PRECISION is a synonym for FLOAT in vertica
170
- when :string then 'VARCHAR' # LONG VARCHAR is not recommended
176
+ when :string then 'VARCHAR' # LONG VARCHAR is not recommended. Default is VARCHAR(80)
171
177
  when :timestamp then 'TIMESTAMP'
172
178
  else raise NotSupportedType, "embulk-output-vertica cannot take column type #{type}"
173
179
  end
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.2.3
4
+ version: 0.2.4
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: 2015-09-16 00:00:00.000000000 Z
12
+ date: 2015-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jvertica