embulk-input-vertica 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +6 -0
- data/README.md +1 -0
- data/build.gradle +1 -1
- data/settings.gradle +1 -0
- data/src/main/java/org/embulk/input/VerticaInputPlugin.java +21 -3
- data/src/main/java/org/embulk/input/vertica/VerticaInputConnection.java +0 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 859d1f2716cc5ff691ed1c040a0be20a00582c34
|
4
|
+
data.tar.gz: b3aee724019f0092802a73e783681f6a9d4f392c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c4bd57db32969f155385b8fc88300297f87575bf44b049fcff832e8b96e30f5be7365938246349674c86e38b6caa456447a81d257f6bfe25aadf606a550bf31
|
7
|
+
data.tar.gz: 1d82ea31cc168a87283ca7e5db7243f8b6d0a5e02833781cc3323f7ac0ba34f1249a8e0655df14d8956a0f900209fbc957dbc934390e3670d8b5c9b385b24e52
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -18,6 +18,7 @@ Vertica input plugins for Embulk loads records from vertica.
|
|
18
18
|
- **fetch_rows**: number of rows to fetch one time (used for java.sql.Statement#setFetchSize) (integer, default: 10000)
|
19
19
|
- **connect_timeout**: timeout for establishment of a database connection. (integer (seconds), default: 300)
|
20
20
|
- **socket_timeout**: timeout for socket read operations. 0 means no timeout. (integer (seconds), default: 1800)
|
21
|
+
- **resource_pool**: set session resource pool (string, default: null)
|
21
22
|
- **ssl**: ~~enables SSL. data will be encrypted but CA or certification will not be verified (boolean, default: false)~~ Not supported yet
|
22
23
|
- **options**: extra JDBC properties (hash, default: {})
|
23
24
|
- If you write SQL directly,
|
data/build.gradle
CHANGED
data/settings.gradle
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rootProject.name = 'embulk-input-vertica'
|
@@ -1,5 +1,9 @@
|
|
1
1
|
package org.embulk.input;
|
2
2
|
|
3
|
+
import com.google.common.base.Optional;
|
4
|
+
|
5
|
+
import java.sql.PreparedStatement;
|
6
|
+
import java.sql.Statement;
|
3
7
|
import java.util.Properties;
|
4
8
|
import java.sql.Connection;
|
5
9
|
import java.sql.Driver;
|
@@ -7,14 +11,15 @@ import java.sql.SQLException;
|
|
7
11
|
import org.embulk.config.Config;
|
8
12
|
import org.embulk.config.ConfigDefault;
|
9
13
|
import org.embulk.input.jdbc.AbstractJdbcInputPlugin;
|
10
|
-
import org.embulk.input.jdbc.getter.ColumnGetterFactory;
|
11
14
|
import org.embulk.input.vertica.VerticaInputConnection;
|
12
|
-
|
13
|
-
import org.
|
15
|
+
|
16
|
+
import org.embulk.spi.Exec;
|
17
|
+
import org.slf4j.Logger;
|
14
18
|
|
15
19
|
public class VerticaInputPlugin
|
16
20
|
extends AbstractJdbcInputPlugin
|
17
21
|
{
|
22
|
+
private final Logger logger = Exec.getLogger(VerticaInputPlugin.class);
|
18
23
|
private static final Driver driver = new com.vertica.jdbc.Driver();
|
19
24
|
|
20
25
|
public interface VerticaPluginTask
|
@@ -40,6 +45,10 @@ public class VerticaInputPlugin
|
|
40
45
|
@Config("schema")
|
41
46
|
@ConfigDefault("\"public\"")
|
42
47
|
public String getSchema();
|
48
|
+
|
49
|
+
@Config("resource_pool")
|
50
|
+
@ConfigDefault("null")
|
51
|
+
public Optional<String> getResourcePool();
|
43
52
|
}
|
44
53
|
|
45
54
|
@Override
|
@@ -77,7 +86,16 @@ public class VerticaInputPlugin
|
|
77
86
|
props.putAll(t.getOptions());
|
78
87
|
|
79
88
|
Connection con = driver.connect(url, props);
|
89
|
+
|
80
90
|
try {
|
91
|
+
if (t.getResourcePool().isPresent()) {
|
92
|
+
Statement stmt = con.createStatement();
|
93
|
+
String escapedResourcePool = t.getResourcePool().get().replaceAll("'", "''");
|
94
|
+
String sql = String.format("SET SESSION RESOURCE_POOL = '%s'", escapedResourcePool);
|
95
|
+
logger.info("SQL: " + sql);
|
96
|
+
stmt.execute(sql);
|
97
|
+
}
|
98
|
+
|
81
99
|
VerticaInputConnection c = new VerticaInputConnection(con, t.getSchema());
|
82
100
|
con = null;
|
83
101
|
return c;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-vertica
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -60,11 +60,12 @@ files:
|
|
60
60
|
- lib/embulk/input/vertica.rb
|
61
61
|
- lib/vertica-jdbc-7.0.1-0.jar
|
62
62
|
- lib/vertica-jdbc-7.2.1-0.jar
|
63
|
+
- settings.gradle
|
63
64
|
- src/main/java/org/embulk/input/VerticaInputPlugin.java
|
64
65
|
- src/main/java/org/embulk/input/vertica/VerticaInputConnection.java
|
65
66
|
- classpath/embulk-core-0.8.8.jar
|
66
67
|
- classpath/embulk-input-jdbc-0.7.0.jar
|
67
|
-
- classpath/embulk-input-vertica-0.1.
|
68
|
+
- classpath/embulk-input-vertica-0.1.2.jar
|
68
69
|
- classpath/joda-time-2.9.2.jar
|
69
70
|
- classpath/jruby-complete-9.0.5.0.jar
|
70
71
|
- classpath/msgpack-core-0.8.3.jar
|