embulk-input-mysql 0.5.0 → 0.6.0

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: 3f02975b24e6df7e4e3fe9eee4366448d02d17ef
4
- data.tar.gz: a3134e8c89d0eb787d397ce2cb26ebd3a07e1b95
3
+ metadata.gz: dd90341b77cceca9532bf385439c2437f8caf517
4
+ data.tar.gz: dd81a39ddc867c7e0c577096792d2178b237dfb9
5
5
  SHA512:
6
- metadata.gz: c4ee7883fa9a550063c961de66927cf4687169fc16a544167822e29bfc3f9a191aff0f071dd9a4229a55a99801cc5d5e98d2b1a06c6b8f3e1c404ac4bfcfc144
7
- data.tar.gz: 3f15c1095f95c81882606f4315d1ae0d3ae0f8dad518745765fdfdd5856de175a013c0a0b666ef5b665bfa75210dd72b11d40d40366af9e6c2aed6d459ea5f97
6
+ metadata.gz: ddd6c09b93413f5bcc36120ba1841193c4f3e662f9f2e8d1652f75c3ebc609113c7c6a144386ccb3ef8956c5eb383d9addfe7f3380f60eabf04b9ae40b6db47a
7
+ data.tar.gz: b7669585a6c96283717542589ed978b53b17c905c7d11cb41d63453e07cfe7783de1a8e73731226c830582d48d39d2393fea1d62e46e1c5f09b2cae8d4bfc2c0
data/README.md CHANGED
@@ -38,7 +38,7 @@ MySQL input plugins for Embulk loads records from MySQL.
38
38
  - **type**: Column values are converted to this embulk type.
39
39
  Available values options are: `boolean`, `long`, `double`, `string`, `timestamp`).
40
40
  By default, the embulk type is determined according to the sql type of the column (or value_type if specified).
41
- - **timestamp_format**: If the sql type of the column is `date`/`time`/`datetime` and the embulk type is `string`, column values are formatted by this timestamp_format. And if the embulk type is `timestamp`, this timestamp_format will be used in the output plugin. (string, default : `%Y-%m-%d` for `date`, `%H:%M:%S` for `time`, `%Y-%m-%d %H:%M:%S` for `timestamp`)
41
+ - **timestamp_format**: If the sql type of the column is `date`/`time`/`datetime` and the embulk type is `string`, column values are formatted by this timestamp_format. And if the embulk type is `timestamp`, this timestamp_format may be used in the output plugin. For example, stdout plugin use the timestamp_format, but *csv formatter plugin doesn't use*. (string, default : `%Y-%m-%d` for `date`, `%H:%M:%S` for `time`, `%Y-%m-%d %H:%M:%S` for `timestamp`)
42
42
  - **timezone**: If the sql type of the column is `date`/`time`/`datetime` and the embulk type is `string`, column values are formatted in this timezone.
43
43
  (string, value of default_timezone option is used by default)
44
44
 
data/build.gradle CHANGED
@@ -3,6 +3,6 @@ dependencies {
3
3
 
4
4
  compile 'mysql:mysql-connector-java:5.1.34'
5
5
 
6
- testCompile 'org.embulk:embulk-standards:0.6.11'
6
+ testCompile 'org.embulk:embulk-standards:0.6.16'
7
7
  testCompile project(':embulk-input-jdbc').sourceSets.test.output
8
8
  }
@@ -74,8 +74,12 @@ public class EmbulkPluginTester
74
74
  Injector injector = service.getInjector();
75
75
  ConfigSource config = injector.getInstance(ConfigLoader.class).fromYamlFile(new File(ymlPath));
76
76
  ExecSession session = new ExecSession(injector, config);
77
- BulkLoader loader = injector.getInstance(BulkLoader.class);
78
- ExecutionResult result = loader.run(session, config);
77
+ try {
78
+ BulkLoader loader = injector.getInstance(BulkLoader.class);
79
+ ExecutionResult result = loader.run(session, config);
80
+ } finally {
81
+ session.cleanup();
82
+ }
79
83
  }
80
84
 
81
85
  }
@@ -97,4 +97,9 @@ public class EmptyConfigSource implements ConfigSource
97
97
  return null;
98
98
  }
99
99
 
100
+ @Override
101
+ public ConfigSource remove(String arg0) {
102
+ return null;
103
+ }
104
+
100
105
  }
@@ -125,7 +125,7 @@ public class MySQLInputPluginTest
125
125
  "c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15",
126
126
  ",,,,,,,,,,,,2015-06-04 14:45:06,,",
127
127
  "99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015-06-03,2015-06-04 03:34:56,2015-06-04 14:45:06,23:04:02,2015-06-03 16:02:03"),
128
- read("mysql-input.000.00.csv"));
128
+ read("mysql-input000.00.csv"));
129
129
  }
130
130
  }
131
131
 
@@ -139,7 +139,7 @@ public class MySQLInputPluginTest
139
139
  "c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15",
140
140
  ",,,,,,,,,,,,2015-06-04 14:45:06,,",
141
141
  "99,9999,-99999999,-9999999999999999,1.2345,1.234567890123,-1234,123456789012345678.12,5678,xy,2015-06-03,2015-06-04 03:34:56,2015-06-04 14:45:06,23:04:02,2015-06-03 16:02:03"),
142
- read("mysql-input.000.00.csv"));
142
+ read("mysql-input000.00.csv"));
143
143
  }
144
144
  }
145
145
 
@@ -153,7 +153,7 @@ public class MySQLInputPluginTest
153
153
  "c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15",
154
154
  ",,,,,,,,,,,,2015-06-04 14:45:06,,",
155
155
  "true,true,false,false,true,true,false,true,,,2015-06-03,2015-06-04 03:34:56,2015-06-04 14:45:06,23:04:02,2015-06-03 16:02:03"),
156
- read("mysql-input.000.00.csv"));
156
+ read("mysql-input000.00.csv"));
157
157
  }
158
158
  }
159
159
 
@@ -167,7 +167,7 @@ public class MySQLInputPluginTest
167
167
  "c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15",
168
168
  ",,,,,,,,,,,,2015-06-04 14:45:06,,",
169
169
  "99,9999,-99999999,-9999999999999999,1,1,-1234,123456789012345678,5678,,2015-06-03,2015-06-04 03:34:56,2015-06-04 14:45:06,23:04:02,2015-06-03 16:02:03"),
170
- read("mysql-input.000.00.csv"));
170
+ read("mysql-input000.00.csv"));
171
171
  }
172
172
  }
173
173
 
@@ -181,7 +181,7 @@ public class MySQLInputPluginTest
181
181
  "c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15",
182
182
  ",,,,,,,,,,,,2015-06-04 14:45:06,,",
183
183
  "99.0,9999.0,-9.9999999E7,-1.0E16,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678.0,,2015-06-03,2015-06-04 03:34:56,2015-06-04 14:45:06,23:04:02,2015-06-03 16:02:03"),
184
- read("mysql-input.000.00.csv"));
184
+ read("mysql-input000.00.csv"));
185
185
  }
186
186
  }
187
187
 
@@ -195,7 +195,7 @@ public class MySQLInputPluginTest
195
195
  "c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15",
196
196
  ",,,,,,,,,,,,2015/06/04 14:45:06,,",
197
197
  "99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015/06/03,2015/06/04 03:34:56,2015/06/04 14:45:06,23-04-02,2015/06/03 16:02:03.123456"),
198
- read("mysql-input.000.00.csv"));
198
+ read("mysql-input000.00.csv"));
199
199
  }
200
200
  }
201
201
 
@@ -209,7 +209,7 @@ public class MySQLInputPluginTest
209
209
  "c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15",
210
210
  ",,,,,,,,,,,,2015/06/04 23:45:06,,",
211
211
  "99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015/06/03,2015/06/04 03:34:56,2015/06/04 23:45:06,08-04-02,2015/06/03 16:02:03.123456"),
212
- read("mysql-input.000.00.csv"));
212
+ read("mysql-input000.00.csv"));
213
213
  }
214
214
  }
215
215
 
@@ -223,7 +223,7 @@ public class MySQLInputPluginTest
223
223
  "c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15",
224
224
  ",,,,,,,,,,,,2015/06/04 23:45:06,,",
225
225
  "99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015/06/04,2015/06/04 12:34:56,2015/06/04 23:45:06,02-04-02,2015/06/04 01:02:03.123456"),
226
- read("mysql-input.000.00.csv"));
226
+ read("mysql-input000.00.csv"));
227
227
  }
228
228
  }
229
229
 
@@ -236,7 +236,7 @@ public class MySQLInputPluginTest
236
236
  assertEquals(Arrays.asList(
237
237
  "c1",
238
238
  "18446744073709551615"),
239
- read("mysql-input.000.00.csv"));
239
+ read("mysql-input000.00.csv"));
240
240
  }
241
241
  }
242
242
 
@@ -249,7 +249,7 @@ public class MySQLInputPluginTest
249
249
  assertEquals(Arrays.asList(
250
250
  "c1",
251
251
  "1.8446744073709552E19"),
252
- read("mysql-input.000.00.csv"));
252
+ read("mysql-input000.00.csv"));
253
253
  }
254
254
  }
255
255
 
@@ -21,6 +21,12 @@ in:
21
21
  out:
22
22
  type: file
23
23
  path_prefix: mysql-input
24
- file_ext: .csv
24
+ file_ext: csv
25
25
  formatter:
26
26
  type: csv
27
+ column_options:
28
+ c11: {format: '%Y-%m-%d'}
29
+ c12: {format: '%Y-%m-%d %H:%M:%S'}
30
+ c13: {format: '%Y-%m-%d %H:%M:%S'}
31
+ c14: {format: '%H:%M:%S'}
32
+ c15: {format: '%Y-%m-%d %H:%M:%S'}
@@ -21,6 +21,12 @@ in:
21
21
  out:
22
22
  type: file
23
23
  path_prefix: mysql-input
24
- file_ext: .csv
24
+ file_ext: csv
25
25
  formatter:
26
26
  type: csv
27
+ column_options:
28
+ c11: {format: '%Y-%m-%d'}
29
+ c12: {format: '%Y-%m-%d %H:%M:%S'}
30
+ c13: {format: '%Y-%m-%d %H:%M:%S'}
31
+ c14: {format: '%H:%M:%S'}
32
+ c15: {format: '%Y-%m-%d %H:%M:%S'}
@@ -21,6 +21,12 @@ in:
21
21
  out:
22
22
  type: file
23
23
  path_prefix: mysql-input
24
- file_ext: .csv
24
+ file_ext: csv
25
25
  formatter:
26
26
  type: csv
27
+ column_options:
28
+ c11: {format: '%Y-%m-%d'}
29
+ c12: {format: '%Y-%m-%d %H:%M:%S'}
30
+ c13: {format: '%Y-%m-%d %H:%M:%S'}
31
+ c14: {format: '%H:%M:%S'}
32
+ c15: {format: '%Y-%m-%d %H:%M:%S'}
@@ -21,6 +21,12 @@ in:
21
21
  out:
22
22
  type: file
23
23
  path_prefix: mysql-input
24
- file_ext: .csv
24
+ file_ext: csv
25
25
  formatter:
26
26
  type: csv
27
+ column_options:
28
+ c11: {format: '%Y-%m-%d'}
29
+ c12: {format: '%Y-%m-%d %H:%M:%S'}
30
+ c13: {format: '%Y-%m-%d %H:%M:%S'}
31
+ c14: {format: '%H:%M:%S'}
32
+ c15: {format: '%Y-%m-%d %H:%M:%S'}
@@ -7,15 +7,26 @@ in:
7
7
  table: test1
8
8
  select: "*"
9
9
  column_options:
10
- c11: {type: timestamp, timestamp_format: '%Y/%m/%d'}
11
- c12: {type: timestamp, timestamp_format: '%Y/%m/%d %H:%M:%S'}
12
- c13: {type: timestamp, timestamp_format: '%Y/%m/%d %H:%M:%S', timezone: '+0900'}
13
- c14: {type: timestamp, timestamp_format: '%H-%M-%S', timezone: '+0900'}
14
- c15: {type: timestamp, timestamp_format: '%Y/%m/%d %H:%M:%S.%6N'}
10
+ #c11: {type: timestamp, timestamp_format: '%Y/%m/%d'}
11
+ #c12: {type: timestamp, timestamp_format: '%Y/%m/%d %H:%M:%S'}
12
+ #c13: {type: timestamp, timestamp_format: '%Y/%m/%d %H:%M:%S', timezone: '+0900'}
13
+ #c14: {type: timestamp, timestamp_format: '%H-%M-%S', timezone: '+0900'}
14
+ #c15: {type: timestamp, timestamp_format: '%Y/%m/%d %H:%M:%S.%6N'}
15
+ c11: {type: timestamp}
16
+ c12: {type: timestamp}
17
+ c13: {type: timestamp}
18
+ c14: {type: timestamp}
19
+ c15: {type: timestamp}
15
20
 
16
21
  out:
17
22
  type: file
18
23
  path_prefix: mysql-input
19
- file_ext: .csv
24
+ file_ext: csv
20
25
  formatter:
21
26
  type: csv
27
+ column_options:
28
+ c11: {format: '%Y/%m/%d'}
29
+ c12: {format: '%Y/%m/%d %H:%M:%S'}
30
+ c13: {format: '%Y/%m/%d %H:%M:%S'}
31
+ c14: {format: '%H-%M-%S'}
32
+ c15: {format: '%Y/%m/%d %H:%M:%S.%6N'}
@@ -16,6 +16,6 @@ in:
16
16
  out:
17
17
  type: file
18
18
  path_prefix: mysql-input
19
- file_ext: .csv
19
+ file_ext: csv
20
20
  formatter:
21
21
  type: csv
@@ -17,6 +17,6 @@ in:
17
17
  out:
18
18
  type: file
19
19
  path_prefix: mysql-input
20
- file_ext: .csv
20
+ file_ext: csv
21
21
  formatter:
22
22
  type: csv
@@ -12,6 +12,6 @@ in:
12
12
  out:
13
13
  type: file
14
14
  path_prefix: mysql-input
15
- file_ext: .csv
15
+ file_ext: csv
16
16
  formatter:
17
17
  type: csv
@@ -12,6 +12,6 @@ in:
12
12
  out:
13
13
  type: file
14
14
  path_prefix: mysql-input
15
- file_ext: .csv
15
+ file_ext: csv
16
16
  formatter:
17
17
  type: csv
@@ -10,6 +10,12 @@ in:
10
10
  out:
11
11
  type: file
12
12
  path_prefix: mysql-input
13
- file_ext: .csv
13
+ file_ext: csv
14
14
  formatter:
15
15
  type: csv
16
+ column_options:
17
+ c11: {format: '%Y-%m-%d'}
18
+ c12: {format: '%Y-%m-%d %H:%M:%S'}
19
+ c13: {format: '%Y-%m-%d %H:%M:%S'}
20
+ c14: {format: '%H:%M:%S'}
21
+ c15: {format: '%Y-%m-%d %H:%M:%S'}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-mysql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-17 00:00:00.000000000 Z
11
+ date: 2015-07-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Selects records from a table.
14
14
  email:
@@ -36,8 +36,8 @@ files:
36
36
  - src/test/resources/yml/input-valuetype-decimal.yml
37
37
  - src/test/resources/yml/input-valuetype-string.yml
38
38
  - src/test/resources/yml/input.yml
39
- - classpath/embulk-input-jdbc-0.5.0.jar
40
- - classpath/embulk-input-mysql-0.5.0.jar
39
+ - classpath/embulk-input-jdbc-0.6.0.jar
40
+ - classpath/embulk-input-mysql-0.6.0.jar
41
41
  - classpath/mysql-connector-java-5.1.34.jar
42
42
  homepage: https://github.com/embulk/embulk-input-jdbc
43
43
  licenses:
Binary file