embulk-input-db2 0.9.2 → 0.9.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a274e1519dcd218fcd33adef14b48453c9f356bf
|
4
|
+
data.tar.gz: dac9ad6be4606b8a0e19af03c6f9da0584d7bc51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 282babd88055da7dd4c31c64a1ca6ed6fbc5f5b41bc07fb077eb2accd0f28c290cd10af706bf2a7a0d0fc911e303369e800fed280cffa9d73492fa8232a4597f
|
7
|
+
data.tar.gz: b430758c3b2eae4fb4cb67cee14ecf5a1437e39ae6163711f1b728ab8fd2f2b522789a4f8cd2476a5f2facc162012e9a6ca698362462fe746807852db137ee70
|
data/README.md
CHANGED
@@ -18,6 +18,7 @@ DB2 input plugins for Embulk loads records from DB2.
|
|
18
18
|
- **schema**: destination schema name (string, default: use the default schema)
|
19
19
|
- If you write SQL directly,
|
20
20
|
- **query**: SQL to run (string)
|
21
|
+
- **use_raw_query_with_incremental**: If true, you can write optimized query using prepared statement by yourself. See [Use incremental loading with raw query](#use-incremental-loading-with-raw-query) for more detail (boolean, default: false)
|
21
22
|
- If **query** is not set,
|
22
23
|
- **table**: destination table name (string, required)
|
23
24
|
- **select**: expression of select (e.g. `id, created_at`) (string, default: "*")
|
@@ -78,6 +79,38 @@ CREATE INDEX embulk_incremental_loading_index ON table (updated_at, id);
|
|
78
79
|
|
79
80
|
Recommended usage is to leave `incremental_columns` unset and let this plugin automatically finds a primary key. Currently, only strings and integers are supported as incremental_columns.
|
80
81
|
|
82
|
+
### Use incremental loading with raw query
|
83
|
+
|
84
|
+
**IMPORTANT**: This is an advanced feature and assume you have an enough knowledge about incremental loading using Embulk and this plugin
|
85
|
+
|
86
|
+
Normally, you can't write your own query for incremental loading.
|
87
|
+
`use_raw_query_with_incremental` option allow you to write raw query for incremental loading. It might be well optimized and faster than SQL statement which is automatically generated by plugin.
|
88
|
+
|
89
|
+
Prepared statement starts with `:` is available instead of fixed value.
|
90
|
+
`last_record` value is necessary when you use this option.
|
91
|
+
Please use prepared statement that is well distinguishable in SQL statement. Using too simple prepared statement like `:a` might cause SQL parse failure.
|
92
|
+
|
93
|
+
In the following example, prepared statement `:foo_id` will be replaced with value "1" which is specified in `last_record`.
|
94
|
+
|
95
|
+
```yaml
|
96
|
+
in:
|
97
|
+
type: jdbc
|
98
|
+
query:
|
99
|
+
SELECT
|
100
|
+
foo.id as foo_id, bar.name
|
101
|
+
FROM
|
102
|
+
foo LEFT JOIN bar ON foo.id = bar.id
|
103
|
+
WHERE
|
104
|
+
foo.hoge IS NOT NULL
|
105
|
+
AND foo.id > :foo_id
|
106
|
+
ORDER BY
|
107
|
+
foo.id ASC
|
108
|
+
use_raw_query_with_incremental: true
|
109
|
+
incremental_columns:
|
110
|
+
- foo_id
|
111
|
+
incremental: true
|
112
|
+
last_record: [1]
|
113
|
+
```
|
81
114
|
|
82
115
|
## Example
|
83
116
|
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-db2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.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: 2018-
|
11
|
+
date: 2018-08-10 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-db2-0.9.
|
23
|
-
- classpath/embulk-input-jdbc-0.9.
|
22
|
+
- classpath/embulk-input-db2-0.9.3.jar
|
23
|
+
- classpath/embulk-input-jdbc-0.9.3.jar
|
24
24
|
- lib/embulk/input/db2.rb
|
25
25
|
- src/main/java/org/embulk/input/DB2InputPlugin.java
|
26
26
|
- src/main/java/org/embulk/input/db2/DB2InputConnection.java
|
Binary file
|
Binary file
|