embulk-output-redshift 0.7.10 → 0.7.11

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: 719b18c2eac69c6fef514b47b0fed5a50bf3cc99
4
- data.tar.gz: 99c2de779340dd07db0d4cf12d5b9660be2cc8fd
3
+ metadata.gz: d64af8464bfac5a262069e316fa1227072de6322
4
+ data.tar.gz: 4b17ad7085953c573fcc56186c5ab1ca93cec8ca
5
5
  SHA512:
6
- metadata.gz: 8e7b75ea9ae85b9cadc7b6feb772a262c775704f8cdfe32016fdc238d62607b1f3aab14eb5547d7a72a2aaef81b747e0a63a9c898afa765693ca292ce08c81d1
7
- data.tar.gz: 7e7fb1b629d5a5623d45fb6885299de94932daac9cc5e476280b7cd02108d36f6f6dc47a4a995f41c0e53c6ad5569313811bc17637de10bf1ddfbe5beaba7992
6
+ metadata.gz: c8d003c33121591debba7c54e942026caa25dfe9f2cf64622f1dd66cfbf8828b8639b149391497bb99659125050dbef00d4ff508beb32d91d401861a239dacc9
7
+ data.tar.gz: 765d334d8521f215d1165b82800bdd5ad3b25f3471fa86f22b4d0676670ada1ab72be25f4bafb87ab97903aa27a7d7173da0cf71830342709703eb88db9073c1
data/README.md CHANGED
@@ -98,7 +98,7 @@ Redshift output plugin for Embulk loads records to Redshift.
98
98
  * Transactional: Yes.
99
99
  * Resumable: No.
100
100
  * **merge**:
101
- * Behavior: This mode writes rows to some intermediate tables first. If all those tasks run correctly, inserts records from intermediate tables after deleting records whose keys exist in intermediate tables. Namely, if merge keys of a record in the intermediate tables already exist in the target table, the target record is updated by the intermediate record, otherwise the intermediate record is inserted. If the target table doesn't exist, it is created automatically.
101
+ * Behavior: This mode writes rows to some intermediate tables first. If all those tasks run correctly, inserts new records from intermediate tables after updating records whose keys exist in intermediate tables. Namely, if merge keys of a record in the intermediate tables already exist in the target table, the target record is updated by the intermediate record, otherwise the intermediate record is inserted. If the target table doesn't exist, it is created automatically.
102
102
  * Transactional: Yes.
103
103
  * Resumable: Yes.
104
104
 
@@ -200,22 +200,23 @@ public class RedshiftOutputConnection
200
200
  }
201
201
  sb.append(" FROM ");
202
202
  quoteTableIdentifier(sb, fromTables.get(i));
203
- sb.append(" WHERE NOT EXISTS (SELECT 1 FROM ");
204
- quoteTableIdentifier(sb, toTable);
205
- sb.append(", ");
206
- quoteTableIdentifier(sb, fromTables.get(i));
207
- sb.append(" WHERE ");
208
203
 
204
+ sb.append(" WHERE (");
209
205
  for (int k = 0; k < mergeKeys.size(); k++) {
210
- if (k != 0) { sb.append(" AND "); }
206
+ if (k != 0) { sb.append(", "); }
211
207
  quoteTableIdentifier(sb, fromTables.get(i));
212
208
  sb.append(".");
213
209
  quoteIdentifierString(sb, mergeKeys.get(k));
214
- sb.append(" = ");
210
+ }
211
+ sb.append(") NOT IN (SELECT ");
212
+ for (int k = 0; k < mergeKeys.size(); k++) {
213
+ if (k != 0) { sb.append(", "); }
215
214
  quoteTableIdentifier(sb, toTable);
216
215
  sb.append(".");
217
216
  quoteIdentifierString(sb, mergeKeys.get(k));
218
217
  }
218
+ sb.append(" FROM ");
219
+ quoteTableIdentifier(sb, toTable);
219
220
  sb.append(")) ");
220
221
  }
221
222
  sb.append(";");
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.10
4
+ version: 0.7.11
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-07-14 00:00:00.000000000 Z
11
+ date: 2017-08-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Inserts or updates records to a table.
14
14
  email:
@@ -25,16 +25,14 @@ 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-core-0.8.9.jar
29
- - classpath/embulk-output-jdbc-0.7.10.jar
30
- - classpath/embulk-output-postgresql-0.7.10.jar
31
- - classpath/embulk-output-redshift-0.7.10.jar
28
+ - classpath/embulk-output-jdbc-0.7.11.jar
29
+ - classpath/embulk-output-postgresql-0.7.11.jar
30
+ - classpath/embulk-output-redshift-0.7.11.jar
32
31
  - classpath/embulk-util-aws-credentials-0.2.8.jar
33
32
  - classpath/httpclient-4.3.6.jar
34
33
  - classpath/httpcore-4.3.3.jar
35
34
  - classpath/jackson-dataformat-cbor-2.5.3.jar
36
35
  - classpath/jcl-over-slf4j-1.7.12.jar
37
- - classpath/msgpack-core-0.8.7.jar
38
36
  - classpath/postgresql-9.4-1205-jdbc41.jar
39
37
  - lib/embulk/output/redshift.rb
40
38
  - src/main/java/org/embulk/output/RedshiftOutputPlugin.java
Binary file
Binary file