embulk-input-redshift 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/classpath/{embulk-input-jdbc-0.2.3.jar → embulk-input-jdbc-0.3.0.jar} +0 -0
- data/classpath/embulk-input-postgresql-0.3.0.jar +0 -0
- data/classpath/embulk-input-redshift-0.3.0.jar +0 -0
- data/src/main/java/org/embulk/input/RedshiftInputPlugin.java +40 -9
- metadata +5 -5
- data/classpath/embulk-input-postgresql-0.2.3.jar +0 -0
- data/classpath/embulk-input-redshift-0.2.3.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e23d4e059b076fec9be77f77c9684131f840d90
|
4
|
+
data.tar.gz: 538f85b4803d2c3d1facebf992ad8e7548126a22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d70ccf9d99d91adfc82efde03b5878fc27cde539679816fda50ba9bd32e4453c9fcf72c0e2cb45592728ff5ad5a908d981a01b348df3e0754d8d515a6d949df
|
7
|
+
data.tar.gz: 7f195f9acd815f07680ff2ebfd81ede4f56b95368da0cf0a242483bc631fae585e83e15aaef0eef8fcaea6b23ab06fa53334158c7c025da86ab72b0d21d27c6a
|
data/README.md
CHANGED
@@ -14,8 +14,8 @@ Redshift input plugins for Embulk loads records from Redshift.
|
|
14
14
|
- **user**: database login user name (string, required)
|
15
15
|
- **password**: database login password (string, default: "")
|
16
16
|
- **database**: destination database name (string, required)
|
17
|
-
- **schema**: destination name (string, default: "public")
|
18
|
-
- **table**: destination name (string, required)
|
17
|
+
- **schema**: destination schema name (string, default: "public")
|
18
|
+
- **table**: destination table name (string, required)
|
19
19
|
- **select**: comma-separated list of columns to select (string, default: "*")
|
20
20
|
- **where**: WHERE condition to filter the rows (string, default: no-condition)
|
21
21
|
- **fetch_rows**: number of rows to fetch one time (used for java.sql.Statement#setFetchSize) (integer, default: 10000)
|
Binary file
|
Binary file
|
Binary file
|
@@ -6,6 +6,7 @@ import java.sql.Driver;
|
|
6
6
|
import java.sql.SQLException;
|
7
7
|
import com.google.common.base.Throwables;
|
8
8
|
import org.embulk.config.Config;
|
9
|
+
import org.embulk.config.ConfigDefault;
|
9
10
|
import org.embulk.input.jdbc.AbstractJdbcInputPlugin;
|
10
11
|
import org.embulk.input.jdbc.AbstractJdbcInputPlugin;
|
11
12
|
import org.embulk.input.postgresql.PostgreSQLInputConnection;
|
@@ -13,20 +14,50 @@ import org.embulk.input.postgresql.PostgreSQLInputConnection;
|
|
13
14
|
public class RedshiftInputPlugin
|
14
15
|
extends AbstractJdbcInputPlugin
|
15
16
|
{
|
16
|
-
private static final String DEFAULT_SCHEMA = "public";
|
17
|
-
private static final int DEFAULT_PORT = 5439;
|
18
|
-
|
19
17
|
private static final Driver driver = new org.postgresql.Driver();
|
20
18
|
|
19
|
+
public interface RedshiftPluginTask
|
20
|
+
extends PluginTask
|
21
|
+
{
|
22
|
+
@Config("host")
|
23
|
+
public String getHost();
|
24
|
+
|
25
|
+
@Config("port")
|
26
|
+
@ConfigDefault("5439")
|
27
|
+
public int getPort();
|
28
|
+
|
29
|
+
@Config("user")
|
30
|
+
public String getUser();
|
31
|
+
|
32
|
+
@Config("password")
|
33
|
+
@ConfigDefault("\"\"")
|
34
|
+
public String getPassword();
|
35
|
+
|
36
|
+
@Config("database")
|
37
|
+
public String getDatabase();
|
38
|
+
|
39
|
+
@Config("schema")
|
40
|
+
@ConfigDefault("\"public\"")
|
41
|
+
public String getSchema();
|
42
|
+
}
|
43
|
+
|
44
|
+
@Override
|
45
|
+
protected Class<? extends PluginTask> getTaskClass()
|
46
|
+
{
|
47
|
+
return RedshiftPluginTask.class;
|
48
|
+
}
|
49
|
+
|
21
50
|
@Override
|
22
51
|
protected PostgreSQLInputConnection newConnection(PluginTask task) throws SQLException
|
23
52
|
{
|
53
|
+
RedshiftPluginTask t = (RedshiftPluginTask) task;
|
54
|
+
|
24
55
|
String url = String.format("jdbc:postgresql://%s:%d/%s",
|
25
|
-
|
56
|
+
t.getHost(), t.getPort(), t.getDatabase());
|
26
57
|
|
27
58
|
Properties props = new Properties();
|
28
|
-
props.setProperty("user",
|
29
|
-
props.setProperty("password",
|
59
|
+
props.setProperty("user", t.getUser());
|
60
|
+
props.setProperty("password", t.getPassword());
|
30
61
|
props.setProperty("loginTimeout", "300"); // seconds
|
31
62
|
props.setProperty("socketTimeout", "1800"); // seconds
|
32
63
|
|
@@ -35,7 +66,7 @@ public class RedshiftInputPlugin
|
|
35
66
|
props.setProperty("tcpKeepAlive", "true");
|
36
67
|
|
37
68
|
// TODO
|
38
|
-
//switch
|
69
|
+
//switch t.getSssl() {
|
39
70
|
//when "disable":
|
40
71
|
// break;
|
41
72
|
//when "enable":
|
@@ -45,11 +76,11 @@ public class RedshiftInputPlugin
|
|
45
76
|
// break;
|
46
77
|
//}
|
47
78
|
|
48
|
-
props.putAll(
|
79
|
+
props.putAll(t.getOptions());
|
49
80
|
|
50
81
|
Connection con = driver.connect(url, props);
|
51
82
|
try {
|
52
|
-
PostgreSQLInputConnection c = new PostgreSQLInputConnection(con,
|
83
|
+
PostgreSQLInputConnection c = new PostgreSQLInputConnection(con, t.getSchema());
|
53
84
|
con = null;
|
54
85
|
return c;
|
55
86
|
} finally {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-redshift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Selects records from a table.
|
14
14
|
email:
|
@@ -21,9 +21,9 @@ files:
|
|
21
21
|
- build.gradle
|
22
22
|
- lib/embulk/input/redshift.rb
|
23
23
|
- src/main/java/org/embulk/input/RedshiftInputPlugin.java
|
24
|
-
- classpath/embulk-input-jdbc-0.
|
25
|
-
- classpath/embulk-input-postgresql-0.
|
26
|
-
- classpath/embulk-input-redshift-0.
|
24
|
+
- classpath/embulk-input-jdbc-0.3.0.jar
|
25
|
+
- classpath/embulk-input-postgresql-0.3.0.jar
|
26
|
+
- classpath/embulk-input-redshift-0.3.0.jar
|
27
27
|
- classpath/jna-4.1.0.jar
|
28
28
|
- classpath/jna-platform-4.1.0.jar
|
29
29
|
- classpath/postgresql-9.4-1200-jdbc41.jar
|
Binary file
|
Binary file
|