embulk-output-redshift 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/build.gradle +2 -2
  4. data/classpath/{aws-java-sdk-core-1.11.253.jar → aws-java-sdk-core-1.11.523.jar} +0 -0
  5. data/classpath/aws-java-sdk-kms-1.11.523.jar +0 -0
  6. data/classpath/aws-java-sdk-s3-1.11.523.jar +0 -0
  7. data/classpath/aws-java-sdk-sts-1.11.523.jar +0 -0
  8. data/classpath/{commons-codec-1.9.jar → commons-codec-1.10.jar} +0 -0
  9. data/classpath/embulk-output-jdbc-0.8.3.jar +0 -0
  10. data/classpath/embulk-output-postgresql-0.8.3.jar +0 -0
  11. data/classpath/embulk-output-redshift-0.8.3.jar +0 -0
  12. data/classpath/httpclient-4.5.5.jar +0 -0
  13. data/classpath/httpcore-4.4.9.jar +0 -0
  14. data/classpath/jackson-databind-2.6.7.2.jar +0 -0
  15. data/classpath/{jmespath-java-1.11.253.jar → jmespath-java-1.11.523.jar} +0 -0
  16. data/src/main/java/org/embulk/output/RedshiftOutputPlugin.java +3 -2
  17. data/src/main/java/org/embulk/output/redshift/RedshiftCopyBatchInsert.java +5 -6
  18. data/src/main/java/org/embulk/output/redshift/RedshiftOutputConnection.java +1 -2
  19. data/src/main/java/org/embulk/output/redshift/RedshiftOutputConnector.java +11 -5
  20. metadata +14 -14
  21. data/classpath/aws-java-sdk-kms-1.11.253.jar +0 -0
  22. data/classpath/aws-java-sdk-s3-1.11.253.jar +0 -0
  23. data/classpath/aws-java-sdk-sts-1.10.77.jar +0 -0
  24. data/classpath/embulk-output-jdbc-0.8.2.jar +0 -0
  25. data/classpath/embulk-output-postgresql-0.8.2.jar +0 -0
  26. data/classpath/embulk-output-redshift-0.8.2.jar +0 -0
  27. data/classpath/httpclient-4.5.2.jar +0 -0
  28. data/classpath/httpcore-4.4.4.jar +0 -0
  29. data/classpath/jackson-databind-2.6.7.1.jar +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0131232d28716e555ccbed240521fd1f0cfd5bd
4
- data.tar.gz: b3eccfb6c93f17f14f3640a504f8ede5ae06b9ff
3
+ metadata.gz: 59e6e32d3500ebab6da91b63717a6a9ea2e1eba9
4
+ data.tar.gz: 04a60823379e8b9c0995de2319382a5dae1b00fe
5
5
  SHA512:
6
- metadata.gz: b57cf72537f09672b125b93211a5e15e4da69b45f9f404334f473c25cc82a42d093577f9733985c15597f4c90372b2d04651b622f30f5b9d63eeb663dc11482a
7
- data.tar.gz: 1d08b9eb2a5b3f2dd66d6ab068038c9c13710e03fe3138f0bd19691f90dd84bfb8ee37fa3e7c7c4247e2f294338b8dd7bfd44e7ebc4ef8d2be612c8dd5b48b0a
6
+ metadata.gz: 80a118548222cfba3055f45c5851a227cb37aff9d6d073db172d3d3b7a1fff707584f9ab8da3102cd433b641711d6b9729a05b125670969a767248af737c05d7
7
+ data.tar.gz: 20905dbeb9830dc7e1bc33fbdcff0245be4abe8282a296ccb6e144d284d6c3f0dcf262bcbe20ccb008c74cb28cb6128642ea48729cbb6a85d3fcf13442d3ce43
data/README.md CHANGED
@@ -21,6 +21,7 @@ Redshift output plugin for Embulk loads records to Redshift.
21
21
  - **table**: destination table name (string, required)
22
22
  - **create_table_constraint**: table constraint added to `CREATE TABLE` statement, like `CREATE TABLE <table_name> (<column1> <type1>, <column2> <type2>, ..., <create_table_constraint>) <create_table_option>`.
23
23
  - **create_table_option**: table option added to `CREATE TABLE` statement, like `CREATE TABLE <table_name> (<column1> <type1>, <column2> <type2>, ..., <create_table_constraint>) <create_table_option>`.
24
+ - **transaction_isolation**: transaction isolation level for each connection ("read_uncommitted", "read_committed", "repeatable_read" or "serializable"). if not specified, database default value will be used.
24
25
  - **access_key_id**: deprecated. `aws_access_key_id` should be used (see "basic" in `aws_auth_method`).
25
26
  - **secret_access_key**: deprecated. `aws_secret_access_key` should be used (see "basic" in `aws_auth_method`).
26
27
  - **aws_auth_method**: name of mechanism to authenticate requests ("basic", "env", "instance", "profile", "properties", "anonymous", "session" or "default". default: "basic")
@@ -74,7 +75,7 @@ Redshift output plugin for Embulk loads records to Redshift.
74
75
  - **s3_key_prefix**: S3 key prefix for temporary files (string, default: "")
75
76
  - **delete_s3_temp_file**: whether to delete temporary files uploaded on S3 (boolean, default: true)
76
77
  - **options**: extra connection properties (hash, default: {})
77
- - **retry_limit**: max retry count for database operations (integer, default: 12)
78
+ - **retry_limit**: max retry count for database operations (integer, default: 12). When intermediate table to create already created by another process, this plugin will retry with another table name to avoid collision.
78
79
  - **retry_wait**: initial retry wait time in milliseconds (integer, default: 1000 (1 second))
79
80
  - **max_retry_wait**: upper limit of retry wait, which will be doubled at every retry (integer, default: 1800000 (30 minutes))
80
81
  - **mode**: "insert", "insert_direct", "truncate_insert", "replace" or "merge". See below. (string, required)
data/build.gradle CHANGED
@@ -2,8 +2,8 @@ dependencies {
2
2
  compile project(':embulk-output-jdbc')
3
3
  compile project(':embulk-output-postgresql')
4
4
 
5
- compile "com.amazonaws:aws-java-sdk-s3:1.10.77"
6
- compile "com.amazonaws:aws-java-sdk-sts:1.10.77"
5
+ compile "com.amazonaws:aws-java-sdk-s3:1.11.523"
6
+ compile "com.amazonaws:aws-java-sdk-sts:1.11.523"
7
7
  compile 'org.embulk.input.s3:embulk-util-aws-credentials:0.2.21'
8
8
 
9
9
  testCompile project(':embulk-output-jdbc').sourceSets.test.output
Binary file
Binary file
@@ -16,6 +16,7 @@ import org.embulk.config.ConfigDefault;
16
16
  import org.embulk.output.jdbc.AbstractJdbcOutputPlugin;
17
17
  import org.embulk.output.jdbc.BatchInsert;
18
18
  import org.embulk.output.jdbc.JdbcOutputConnection;
19
+ import org.embulk.output.jdbc.JdbcOutputConnector;
19
20
  import org.embulk.output.jdbc.MergeConfig;
20
21
  import org.embulk.output.jdbc.TableIdentifier;
21
22
  import org.embulk.output.jdbc.Ssl;
@@ -100,7 +101,7 @@ public class RedshiftOutputPlugin
100
101
  }
101
102
 
102
103
  @Override
103
- protected RedshiftOutputConnector getConnector(PluginTask task, boolean retryableMetadataOperation)
104
+ protected JdbcOutputConnector getConnector(PluginTask task, boolean retryableMetadataOperation)
104
105
  {
105
106
  RedshiftPluginTask t = (RedshiftPluginTask) task;
106
107
 
@@ -140,7 +141,7 @@ public class RedshiftOutputPlugin
140
141
  props.setProperty("password", t.getPassword());
141
142
  logConnectionProperties(url, props);
142
143
 
143
- return new RedshiftOutputConnector(url, props, t.getSchema());
144
+ return new RedshiftOutputConnector(url, props, t.getSchema(), t.getTransactionIsolation());
144
145
  }
145
146
 
146
147
  private static AWSCredentialsProvider getAWSCredentialsProvider(RedshiftPluginTask task)
@@ -17,6 +17,7 @@ import java.util.concurrent.Future;
17
17
  import java.util.concurrent.TimeUnit;
18
18
  import java.util.zip.GZIPOutputStream;
19
19
 
20
+ import org.embulk.output.jdbc.JdbcOutputConnector;
20
21
  import org.embulk.output.jdbc.JdbcSchema;
21
22
  import org.embulk.output.jdbc.TableIdentifier;
22
23
  import org.embulk.output.postgresql.AbstractPostgreSQLCopyBatchInsert;
@@ -42,7 +43,7 @@ public class RedshiftCopyBatchInsert
42
43
  extends AbstractPostgreSQLCopyBatchInsert
43
44
  {
44
45
  private final Logger logger = Exec.getLogger(RedshiftCopyBatchInsert.class);
45
- private final RedshiftOutputConnector connector;
46
+ private final JdbcOutputConnector connector;
46
47
  private final String s3BucketName;
47
48
  private final String s3KeyPrefix;
48
49
  private final String iamReaderUserName;
@@ -61,7 +62,7 @@ public class RedshiftCopyBatchInsert
61
62
 
62
63
  public static final String COPY_AFTER_FROM = "GZIP DELIMITER '\\t' NULL '\\\\N' ESCAPE TRUNCATECOLUMNS ACCEPTINVCHARS STATUPDATE OFF COMPUPDATE OFF";
63
64
 
64
- public RedshiftCopyBatchInsert(RedshiftOutputConnector connector,
65
+ public RedshiftCopyBatchInsert(JdbcOutputConnector connector,
65
66
  AWSCredentialsProvider credentialsProvider, String s3BucketName, String s3KeyPrefix,
66
67
  String iamReaderUserName, boolean deleteS3TempFile) throws IOException, SQLException
67
68
  {
@@ -98,7 +99,7 @@ public class RedshiftCopyBatchInsert
98
99
  @Override
99
100
  public void prepare(TableIdentifier loadTable, JdbcSchema insertSchema) throws SQLException
100
101
  {
101
- this.connection = connector.connect(true);
102
+ this.connection = (RedshiftOutputConnection)connector.connect(true);
102
103
  this.copySqlBeforeFrom = connection.buildCopySQLBeforeFrom(loadTable, insertSchema);
103
104
  logger.info("Copy SQL: "+copySqlBeforeFrom+" ? "+COPY_AFTER_FROM);
104
105
  }
@@ -137,8 +138,6 @@ public class RedshiftCopyBatchInsert
137
138
  @Override
138
139
  public void finish() throws IOException, SQLException
139
140
  {
140
- super.finish();
141
-
142
141
  for (Future<Void> uploadAndCopyFuture : uploadAndCopyFutures) {
143
142
  try {
144
143
  uploadAndCopyFuture.get();
@@ -269,7 +268,7 @@ public class RedshiftCopyBatchInsert
269
268
  try {
270
269
  uploadFuture.get();
271
270
 
272
- RedshiftOutputConnection con = connector.connect(true);
271
+ RedshiftOutputConnection con = (RedshiftOutputConnection)connector.connect(true);
273
272
  try {
274
273
  logger.info("Running COPY from file {}", s3KeyName);
275
274
 
@@ -19,11 +19,10 @@ public class RedshiftOutputConnection
19
19
  {
20
20
  private final Logger logger = Exec.getLogger(RedshiftOutputConnection.class);
21
21
 
22
- public RedshiftOutputConnection(Connection connection, String schemaName, boolean autoCommit)
22
+ public RedshiftOutputConnection(Connection connection, String schemaName)
23
23
  throws SQLException
24
24
  {
25
25
  super(connection, schemaName);
26
- connection.setAutoCommit(autoCommit);
27
26
  }
28
27
 
29
28
  // ALTER TABLE cannot change the schema of a table
@@ -4,11 +4,15 @@ import java.util.Properties;
4
4
  import java.sql.Driver;
5
5
  import java.sql.Connection;
6
6
  import java.sql.SQLException;
7
- import org.embulk.output.jdbc.JdbcOutputConnector;
7
+
8
+ import org.embulk.output.jdbc.AbstractJdbcOutputConnector;
8
9
  import org.embulk.output.jdbc.JdbcOutputConnection;
10
+ import org.embulk.output.jdbc.TransactionIsolation;
11
+
12
+ import com.google.common.base.Optional;
9
13
 
10
14
  public class RedshiftOutputConnector
11
- implements JdbcOutputConnector
15
+ extends AbstractJdbcOutputConnector
12
16
  {
13
17
  private static final Driver driver = new org.postgresql.Driver();
14
18
 
@@ -16,19 +20,21 @@ public class RedshiftOutputConnector
16
20
  private final Properties properties;
17
21
  private final String schemaName;
18
22
 
19
- public RedshiftOutputConnector(String url, Properties properties, String schemaName)
23
+ public RedshiftOutputConnector(String url, Properties properties, String schemaName,
24
+ Optional<TransactionIsolation> transactionIsolation)
20
25
  {
26
+ super(transactionIsolation);
21
27
  this.url = url;
22
28
  this.properties = properties;
23
29
  this.schemaName = schemaName;
24
30
  }
25
31
 
26
32
  @Override
27
- public RedshiftOutputConnection connect(boolean autoCommit) throws SQLException
33
+ protected JdbcOutputConnection connect() throws SQLException
28
34
  {
29
35
  Connection c = driver.connect(url, properties);
30
36
  try {
31
- RedshiftOutputConnection con = new RedshiftOutputConnection(c, schemaName, autoCommit);
37
+ RedshiftOutputConnection con = new RedshiftOutputConnection(c, schemaName);
32
38
  c = null;
33
39
  return con;
34
40
  } finally {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-redshift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-30 00:00:00.000000000 Z
11
+ date: 2019-05-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Inserts or updates records to a table.
14
14
  email:
@@ -19,23 +19,23 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - README.md
21
21
  - build.gradle
22
- - classpath/aws-java-sdk-core-1.11.253.jar
23
- - classpath/aws-java-sdk-kms-1.11.253.jar
24
- - classpath/aws-java-sdk-s3-1.11.253.jar
25
- - classpath/aws-java-sdk-sts-1.10.77.jar
26
- - classpath/commons-codec-1.9.jar
22
+ - classpath/aws-java-sdk-core-1.11.523.jar
23
+ - classpath/aws-java-sdk-kms-1.11.523.jar
24
+ - classpath/aws-java-sdk-s3-1.11.523.jar
25
+ - classpath/aws-java-sdk-sts-1.11.523.jar
26
+ - classpath/commons-codec-1.10.jar
27
27
  - classpath/commons-logging-1.2.jar
28
- - classpath/embulk-output-jdbc-0.8.2.jar
29
- - classpath/embulk-output-postgresql-0.8.2.jar
30
- - classpath/embulk-output-redshift-0.8.2.jar
28
+ - classpath/embulk-output-jdbc-0.8.3.jar
29
+ - classpath/embulk-output-postgresql-0.8.3.jar
30
+ - classpath/embulk-output-redshift-0.8.3.jar
31
31
  - classpath/embulk-util-aws-credentials-0.2.21.jar
32
- - classpath/httpclient-4.5.2.jar
33
- - classpath/httpcore-4.4.4.jar
32
+ - classpath/httpclient-4.5.5.jar
33
+ - classpath/httpcore-4.4.9.jar
34
34
  - classpath/ion-java-1.0.2.jar
35
- - classpath/jackson-databind-2.6.7.1.jar
35
+ - classpath/jackson-databind-2.6.7.2.jar
36
36
  - classpath/jackson-dataformat-cbor-2.6.7.jar
37
37
  - classpath/jcl-over-slf4j-1.7.12.jar
38
- - classpath/jmespath-java-1.11.253.jar
38
+ - classpath/jmespath-java-1.11.523.jar
39
39
  - classpath/postgresql-9.4-1205-jdbc41.jar
40
40
  - lib/embulk/output/redshift.rb
41
41
  - src/main/java/org/embulk/output/RedshiftOutputPlugin.java
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file