embulk-output-redshift 0.7.12 → 0.7.13
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/README.md +4 -1
- data/classpath/embulk-output-jdbc-0.7.13.jar +0 -0
- data/classpath/{embulk-output-postgresql-0.7.12.jar → embulk-output-postgresql-0.7.13.jar} +0 -0
- data/classpath/embulk-output-redshift-0.7.13.jar +0 -0
- data/src/main/java/org/embulk/output/RedshiftOutputPlugin.java +6 -2
- data/src/main/java/org/embulk/output/redshift/RedshiftCopyBatchInsert.java +6 -2
- metadata +5 -5
- data/classpath/embulk-output-jdbc-0.7.12.jar +0 -0
- data/classpath/embulk-output-redshift-0.7.12.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: 306629e8d5f5a0a452aa9e341d0e564f4d7599f7
|
4
|
+
data.tar.gz: dc5fef08ee347b5e72065a051d6769b16bbab7cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36ed60b43124aae3ab0352c627e4fb54ddf103c943d39bc1db619112a9f0e5054489fbb390cc4ee67c3f5a234059ebba41be27311cb9ea9ce5bce11d69f1ec8b
|
7
|
+
data.tar.gz: baf054ea4d486e697f93b70f2304f5b59ff46c18ed97d34200922de099434e85a86a29f17884c5a64646a9e5c9a9e3441c450fc72b0943c2129e3c20989ad8d9
|
data/README.md
CHANGED
@@ -19,6 +19,8 @@ Redshift output plugin for Embulk loads records to Redshift.
|
|
19
19
|
- **schema**: destination schema name (string, default: "public")
|
20
20
|
- **temp_schema**: schema name for intermediate tables. by default, intermediate tables will be created in the schema specified by `schema`. replace mode doesn't support temp_schema. (string, optional)
|
21
21
|
- **table**: destination table name (string, required)
|
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
|
+
- **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>`.
|
22
24
|
- **access_key_id**: deprecated. `aws_access_key_id` should be used (see "basic" in `aws_auth_method`).
|
23
25
|
- **secret_access_key**: deprecated. `aws_secret_access_key` should be used (see "basic" in `aws_auth_method`).
|
24
26
|
- **aws_auth_method**: name of mechanism to authenticate requests ("basic", "env", "instance", "profile", "properties", "anonymous", or "session". default: "basic")
|
@@ -62,7 +64,8 @@ Redshift output plugin for Embulk loads records to Redshift.
|
|
62
64
|
|
63
65
|
- **iam_user_name**: IAM user name for uploading temporary files to S3. The user should have permissions of `s3:GetObject`, `s3:PutObject`, `s3:DeleteObject`, `s3:ListBucket` and `sts:GetFederationToken`. And furthermore, the user should have permission of `s3:GetBucketLocation` if Redshift region and S3 bucket region are different. (string, default: "", but we strongly recommend that you use IAM user for security reasons. see below.)
|
64
66
|
- **s3_bucket**: S3 bucket name for temporary files
|
65
|
-
- **s3_key_prefix**: S3 key prefix for temporary files (string, default:"")
|
67
|
+
- **s3_key_prefix**: S3 key prefix for temporary files (string, default: "")
|
68
|
+
- **delete_s3_temp_file**: whether to delete temporary files uploaded on S3 (boolean, default: true)
|
66
69
|
- **options**: extra connection properties (hash, default: {})
|
67
70
|
- **retry_limit** max retry count for database operations (integer, default: 12)
|
68
71
|
- **retry_wait** initial retry wait time in milliseconds (integer, default: 1000 (1 second))
|
Binary file
|
Binary file
|
Binary file
|
@@ -75,6 +75,10 @@ public class RedshiftOutputPlugin
|
|
75
75
|
@ConfigDefault("\"\"")
|
76
76
|
public String getS3KeyPrefix();
|
77
77
|
|
78
|
+
@Config("delete_s3_temp_file")
|
79
|
+
@ConfigDefault("true")
|
80
|
+
public boolean getDeleteS3TempFile();
|
81
|
+
|
78
82
|
@Config("ssl")
|
79
83
|
@ConfigDefault("\"disable\"")
|
80
84
|
public Ssl getSsl();
|
@@ -90,7 +94,7 @@ public class RedshiftOutputPlugin
|
|
90
94
|
protected Features getFeatures(PluginTask task)
|
91
95
|
{
|
92
96
|
return new Features()
|
93
|
-
.setMaxTableNameLength(
|
97
|
+
.setMaxTableNameLength(127)
|
94
98
|
.setSupportedModes(ImmutableSet.of(Mode.INSERT, Mode.INSERT_DIRECT, Mode.TRUNCATE_INSERT, Mode.REPLACE, Mode.MERGE))
|
95
99
|
.setIgnoreMergeKeys(false);
|
96
100
|
}
|
@@ -188,6 +192,6 @@ public class RedshiftOutputPlugin
|
|
188
192
|
RedshiftPluginTask t = (RedshiftPluginTask) task;
|
189
193
|
setAWSCredentialsBackwardCompatibility(t);
|
190
194
|
return new RedshiftCopyBatchInsert(getConnector(task, true),
|
191
|
-
getAWSCredentialsProvider(t), t.getS3Bucket(), t.getS3KeyPrefix(), t.getIamUserName());
|
195
|
+
getAWSCredentialsProvider(t), t.getS3Bucket(), t.getS3KeyPrefix(), t.getIamUserName(), t.getDeleteS3TempFile());
|
192
196
|
}
|
193
197
|
}
|
@@ -46,6 +46,7 @@ public class RedshiftCopyBatchInsert
|
|
46
46
|
private final String s3BucketName;
|
47
47
|
private final String s3KeyPrefix;
|
48
48
|
private final String iamReaderUserName;
|
49
|
+
private final boolean deleteS3TempFile;
|
49
50
|
private final AWSCredentialsProvider credentialsProvider;
|
50
51
|
private final AmazonS3Client s3;
|
51
52
|
private final String s3RegionName;
|
@@ -62,7 +63,7 @@ public class RedshiftCopyBatchInsert
|
|
62
63
|
|
63
64
|
public RedshiftCopyBatchInsert(RedshiftOutputConnector connector,
|
64
65
|
AWSCredentialsProvider credentialsProvider, String s3BucketName, String s3KeyPrefix,
|
65
|
-
String iamReaderUserName) throws IOException, SQLException
|
66
|
+
String iamReaderUserName, boolean deleteS3TempFile) throws IOException, SQLException
|
66
67
|
{
|
67
68
|
super();
|
68
69
|
this.connector = connector;
|
@@ -73,6 +74,7 @@ public class RedshiftCopyBatchInsert
|
|
73
74
|
this.s3KeyPrefix = s3KeyPrefix + "/";
|
74
75
|
}
|
75
76
|
this.iamReaderUserName = iamReaderUserName;
|
77
|
+
this.deleteS3TempFile = deleteS3TempFile;
|
76
78
|
this.credentialsProvider = credentialsProvider;
|
77
79
|
this.s3 = new AmazonS3Client(credentialsProvider); // TODO options
|
78
80
|
this.sts = new AWSSecurityTokenServiceClient(credentialsProvider); // options
|
@@ -268,7 +270,9 @@ public class RedshiftCopyBatchInsert
|
|
268
270
|
con.close();
|
269
271
|
}
|
270
272
|
} finally {
|
271
|
-
|
273
|
+
if (deleteS3TempFile) {
|
274
|
+
s3.deleteObject(s3BucketName, s3KeyName);
|
275
|
+
}
|
272
276
|
}
|
273
277
|
|
274
278
|
return null;
|
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.7.
|
4
|
+
version: 0.7.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Inserts or updates records to a table.
|
14
14
|
email:
|
@@ -25,9 +25,9 @@ files:
|
|
25
25
|
- classpath/aws-java-sdk-sts-1.10.77.jar
|
26
26
|
- classpath/commons-codec-1.6.jar
|
27
27
|
- classpath/commons-logging-1.1.3.jar
|
28
|
-
- classpath/embulk-output-jdbc-0.7.
|
29
|
-
- classpath/embulk-output-postgresql-0.7.
|
30
|
-
- classpath/embulk-output-redshift-0.7.
|
28
|
+
- classpath/embulk-output-jdbc-0.7.13.jar
|
29
|
+
- classpath/embulk-output-postgresql-0.7.13.jar
|
30
|
+
- classpath/embulk-output-redshift-0.7.13.jar
|
31
31
|
- classpath/embulk-util-aws-credentials-0.2.8.jar
|
32
32
|
- classpath/httpclient-4.3.6.jar
|
33
33
|
- classpath/httpcore-4.3.3.jar
|
Binary file
|
Binary file
|