embulk-input-postgresql 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- 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/src/test/java/org/embulk/input/postgresql/IncrementalTest.java +32 -0
- data/src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/config_1.yml +3 -0
- data/src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/config_2.yml +4 -0
- data/src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/expected_1.csv +4 -0
- data/src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/expected_1.diff +3 -0
- data/src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/expected_2.csv +2 -0
- data/src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/expected_2.diff +3 -0
- data/src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/insert_more.sql +7 -0
- data/src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/setup.sql +13 -0
- metadata +12 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45d7ceaf1d590b58cf1cbfbc244683d21471daf2d81c1fef38ed4a816949f06d
|
4
|
+
data.tar.gz: d83b6752173718098551891444919a73034680b9961cc3fd25bd3de79d6b67a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c388f481f1b58c12a011c5bba7f88574cb77bf54b8196b582bcabfab3a12a4d996b894ac62a69cbd0f88ce16a10b887f8dc03c89ed6cb8c70a38c3b2b8e1200
|
7
|
+
data.tar.gz: 9f34796f9acfd2be545f790e005e6d058fbccd9d5e630e4a75ea8824aef17c4fab9c2bf0280e7b9a906b5ba98e85c283528b45231d4d3bf291cb5aad241f5963
|
data/README.md
CHANGED
@@ -31,7 +31,7 @@ PostgreSQL input plugin for Embulk loads records from PostgreSQL.
|
|
31
31
|
- **where**: WHERE condition to filter the rows (string, default: no-condition)
|
32
32
|
- **order_by**: expression of ORDER BY to sort rows (e.g. `created_at DESC, id ASC`) (string, default: not sorted)
|
33
33
|
- **incremental**: if true, enables incremental loading. See next section for details (boolean, default: false)
|
34
|
-
- **incremental_columns**: column names for incremental loading (array of strings, default: use primary keys)
|
34
|
+
- **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.
|
35
35
|
- **last_record**: values of the last record for incremental loading (array of objects, default: load all records)
|
36
36
|
- **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`)
|
37
37
|
- **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.
|
@@ -98,13 +98,13 @@ ORDER BY updated_at, id
|
|
98
98
|
|
99
99
|
When bulk data loading finishes successfully, it outputs `last_record: ` paramater as config-diff so that next execution uses it.
|
100
100
|
|
101
|
-
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-
|
101
|
+
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,
|
102
102
|
|
103
103
|
```
|
104
104
|
SELECT * FROM (
|
105
105
|
...original query is here...
|
106
106
|
)
|
107
|
-
WHERE updated_at > '2017-01-01 00:32:12' OR (updated_at = '2017-01-01 00:32:12' AND id > 5291)
|
107
|
+
WHERE updated_at > '2017-01-01 00:32:12.487659' OR (updated_at = '2017-01-01 00:32:12.487659' AND id > 5291)
|
108
108
|
ORDER BY updated_at, id
|
109
109
|
```
|
110
110
|
|
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-postgresql
|
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,8 +19,8 @@ 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.
|
22
|
+
- classpath/embulk-input-jdbc-0.10.1.jar
|
23
|
+
- classpath/embulk-input-postgresql-0.10.1.jar
|
24
24
|
- default_jdbc_driver/postgresql-9.4-1205-jdbc41.jar
|
25
25
|
- lib/embulk/input/postgresql.rb
|
26
26
|
- src/main/java/org/embulk/input/PostgreSQLInputPlugin.java
|
@@ -43,6 +43,14 @@ files:
|
|
43
43
|
- src/test/resources/org/embulk/input/postgresql/test/expect/hstore/expected_json.csv
|
44
44
|
- src/test/resources/org/embulk/input/postgresql/test/expect/hstore/expected_string.csv
|
45
45
|
- src/test/resources/org/embulk/input/postgresql/test/expect/hstore/setup.sql
|
46
|
+
- src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/config_1.yml
|
47
|
+
- src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/config_2.yml
|
48
|
+
- src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/expected_1.csv
|
49
|
+
- src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/expected_1.diff
|
50
|
+
- src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/expected_2.csv
|
51
|
+
- src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/expected_2.diff
|
52
|
+
- src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/insert_more.sql
|
53
|
+
- src/test/resources/org/embulk/input/postgresql/test/expect/incremental/char/setup.sql
|
46
54
|
- src/test/resources/org/embulk/input/postgresql/test/expect/incremental/int/config_1.yml
|
47
55
|
- src/test/resources/org/embulk/input/postgresql/test/expect/incremental/int/config_2.yml
|
48
56
|
- src/test/resources/org/embulk/input/postgresql/test/expect/incremental/int/expected_1.csv
|