embulk-input-db2 0.9.2 → 0.9.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d08ab7abf4c79aaa82cc555d204de0cdbffcea7
4
- data.tar.gz: 742cffcecb346a6f865260f1b6abab21f94f9138
3
+ metadata.gz: a274e1519dcd218fcd33adef14b48453c9f356bf
4
+ data.tar.gz: dac9ad6be4606b8a0e19af03c6f9da0584d7bc51
5
5
  SHA512:
6
- metadata.gz: af45fc65bb03444988511e9983bdddd7b7d023ae823f79145764c1500883dce3cd9cbb18063459870356d725f4587417690d3f8d982d05363e774cab39061ae9
7
- data.tar.gz: dda1241d406df064f580c8be907991d8053d4c550a093935a34da4990e12e40283787bec4a1051aa951d6563f753e2f7e723909058c0040ff2303445bd5075cb
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
 
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.2
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-07-03 00:00:00.000000000 Z
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.2.jar
23
- - classpath/embulk-input-jdbc-0.9.2.jar
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