embulk-input-redshift 0.10.0 → 0.10.1
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 +3 -3
- data/classpath/{embulk-input-jdbc-0.10.0.jar → embulk-input-jdbc-0.10.1.jar} +0 -0
- data/classpath/{embulk-input-postgresql-0.10.0.jar → embulk-input-postgresql-0.10.1.jar} +0 -0
- data/classpath/{embulk-input-redshift-0.10.0.jar → embulk-input-redshift-0.10.1.jar} +0 -0
- data/src/test/java/org/embulk/input/redshift/IncrementalTest.java +32 -0
- data/src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/config_1.yml +3 -0
- data/src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/config_2.yml +4 -0
- data/src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/expected_1.csv +4 -0
- data/src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/expected_1.diff +3 -0
- data/src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/expected_2.csv +2 -0
- data/src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/expected_2.diff +3 -0
- data/src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/insert_more.sql +6 -0
- data/src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/setup.sql +12 -0
- metadata +13 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d90c302f2b33a493831a26dcb2b4e0708a74d8678b592150575f242653404006
|
4
|
+
data.tar.gz: 5d5940e37cfced39c520bf65f0818dd83df69bccf18055359897672d2b84f312
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e699117348eaffd2f0186af536fac8972c23c8866536b15ad683a196b1f2b5204b4c7e7f87e9601cce83bc3e2972452f6606d5cd4e5903681b5fd18153bae68
|
7
|
+
data.tar.gz: f4a057665b092d6fadbe533d92ea12b71ac654302b5be14050ecb0ec72c25da16d3c2d5e9e2c36255751fbc81c41fff2351f888e547e61bef6edf4d7b4febd78
|
data/README.md
CHANGED
@@ -30,7 +30,7 @@ Redshift input plugin for Embulk loads records from Redshift.
|
|
30
30
|
- **where**: WHERE condition to filter the rows (string, default: no-condition)
|
31
31
|
- **order_by**: expression of ORDER BY to sort rows (e.g. `created_at DESC, id ASC`) (string, default: not sorted)
|
32
32
|
- **incremental**: if true, enables incremental loading. See next section for details (boolean, default: false)
|
33
|
-
- **incremental_columns**: column names for incremental loading (array of strings, default: use primary keys)
|
33
|
+
- **incremental_columns**: column names for incremental loading (array of strings, default: use primary keys). Columns of integer types, string types, `timestamp` and `timestamptz` are supported.
|
34
34
|
- **last_record**: values of the last record for incremental loading (array of objects, default: load all records)
|
35
35
|
- **default_timezone**: If the sql type of a column is `date`/`time`/`datetime` and the embulk type is `string`, column values are formatted int this default_timezone. You can overwrite timezone for each columns using column_options option. (string, default: `UTC`)
|
36
36
|
- **default_column_options**: advanced: column_options for each JDBC type as default. key-value pairs where key is a JDBC type (e.g. 'DATE', 'BIGINT') and value is same as column_options's value.
|
@@ -63,13 +63,13 @@ ORDER BY updated_at, id
|
|
63
63
|
|
64
64
|
When bulk data loading finishes successfully, it outputs `last_record: ` paramater as config-diff so that next execution uses it.
|
65
65
|
|
66
|
-
At the next execution, when `last_record: ` is also set, this plugin generates additional WHERE conditions to load records larger than the last record. For example, if `last_record: ["2017-01-
|
66
|
+
At the next execution, when `last_record: ` is also set, this plugin generates additional WHERE conditions to load records larger than the last record. For example, if `last_record: ["2017-01-01T00:32:12.487659", 5291]` is set,
|
67
67
|
|
68
68
|
```
|
69
69
|
SELECT * FROM (
|
70
70
|
...original query is here...
|
71
71
|
)
|
72
|
-
WHERE updated_at > '2017-01-01 00:32:12' OR (updated_at = '2017-01-01 00:32:12' AND id > 5291)
|
72
|
+
WHERE updated_at > '2017-01-01 00:32:12.487659' OR (updated_at = '2017-01-01 00:32:12.487659' AND id > 5291)
|
73
73
|
ORDER BY updated_at, id
|
74
74
|
```
|
75
75
|
|
Binary file
|
Binary file
|
Binary file
|
@@ -77,6 +77,38 @@ public class IncrementalTest
|
|
77
77
|
is((ConfigDiff) loadYamlResource(embulk, "int/expected_2.diff")));
|
78
78
|
}
|
79
79
|
|
80
|
+
@Test
|
81
|
+
public void simpleChar() throws Exception
|
82
|
+
{
|
83
|
+
// setup first rows
|
84
|
+
execute(readResource("char/setup.sql"));
|
85
|
+
|
86
|
+
Path out1 = embulk.createTempFile("csv");
|
87
|
+
RunResult result1 = embulk.runInput(
|
88
|
+
baseConfig.merge(loadYamlResource(embulk, "char/config_1.yml")),
|
89
|
+
out1);
|
90
|
+
assertThat(
|
91
|
+
readSortedFile(out1),
|
92
|
+
is(readResource("char/expected_1.csv")));
|
93
|
+
assertThat(
|
94
|
+
result1.getConfigDiff(),
|
95
|
+
is((ConfigDiff) loadYamlResource(embulk, "char/expected_1.diff")));
|
96
|
+
|
97
|
+
// insert more rows
|
98
|
+
execute(readResource("char/insert_more.sql"));
|
99
|
+
|
100
|
+
Path out2 = embulk.createTempFile("csv");
|
101
|
+
RunResult result2 = embulk.runInput(
|
102
|
+
baseConfig.merge(loadYamlResource(embulk, "char/config_2.yml")),
|
103
|
+
out2);
|
104
|
+
assertThat(
|
105
|
+
readSortedFile(out2),
|
106
|
+
is(readResource("char/expected_2.csv")));
|
107
|
+
assertThat(
|
108
|
+
result2.getConfigDiff(),
|
109
|
+
is((ConfigDiff) loadYamlResource(embulk, "char/expected_2.diff")));
|
110
|
+
}
|
111
|
+
|
80
112
|
@Test
|
81
113
|
public void simpleTimestampWithoutTimeZone() throws Exception
|
82
114
|
{
|
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.10.
|
4
|
+
version: 0.10.1
|
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-
|
11
|
+
date: 2019-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Selects records from a table.
|
14
14
|
email:
|
@@ -19,15 +19,23 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- README.md
|
21
21
|
- build.gradle
|
22
|
-
- classpath/embulk-input-jdbc-0.10.
|
23
|
-
- classpath/embulk-input-postgresql-0.10.
|
24
|
-
- classpath/embulk-input-redshift-0.10.
|
22
|
+
- classpath/embulk-input-jdbc-0.10.1.jar
|
23
|
+
- classpath/embulk-input-postgresql-0.10.1.jar
|
24
|
+
- classpath/embulk-input-redshift-0.10.1.jar
|
25
25
|
- classpath/postgresql-9.4-1205-jdbc41.jar
|
26
26
|
- lib/embulk/input/redshift.rb
|
27
27
|
- src/main/java/org/embulk/input/RedshiftInputPlugin.java
|
28
28
|
- src/main/java/org/embulk/input/redshift/getter/RedshiftColumnGetterFactory.java
|
29
29
|
- src/test/java/org/embulk/input/redshift/IncrementalTest.java
|
30
30
|
- src/test/java/org/embulk/input/redshift/RedshiftTests.java
|
31
|
+
- src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/config_1.yml
|
32
|
+
- src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/config_2.yml
|
33
|
+
- src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/expected_1.csv
|
34
|
+
- src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/expected_1.diff
|
35
|
+
- src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/expected_2.csv
|
36
|
+
- src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/expected_2.diff
|
37
|
+
- src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/insert_more.sql
|
38
|
+
- src/test/resources/org/embulk/input/redshift/test/expect/incremental/char/setup.sql
|
31
39
|
- src/test/resources/org/embulk/input/redshift/test/expect/incremental/int/config_1.yml
|
32
40
|
- src/test/resources/org/embulk/input/redshift/test/expect/incremental/int/config_2.yml
|
33
41
|
- src/test/resources/org/embulk/input/redshift/test/expect/incremental/int/expected_1.csv
|