embulk-input-mysql 0.8.1 → 0.9.0
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 -1
- data/build.gradle +2 -1
- data/classpath/embulk-input-jdbc-0.9.0.jar +0 -0
- data/classpath/embulk-input-mysql-0.9.0.jar +0 -0
- data/default_jdbc_driver/mysql-connector-java-5.1.44.jar +0 -0
- data/src/main/java/org/embulk/input/MySQLInputPlugin.java +44 -29
- data/src/main/java/org/embulk/input/mysql/MySQLInputConnection.java +25 -4
- data/src/main/java/org/embulk/input/mysql/getter/AbstractMySQLTimestampIncrementalHandler.java +25 -10
- data/src/main/java/org/embulk/input/mysql/getter/MySQLTimestampTimestampIncrementalHandler.java +1 -2
- data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_boolean_expected.csv +2 -2
- data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_double_expected.csv +2 -2
- data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_expected.csv +2 -2
- data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_long_expected.csv +2 -2
- data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_string_expected.csv +2 -2
- data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp1_expected.csv +2 -2
- data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp2_expected.csv +2 -2
- data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp3_expected.csv +2 -2
- data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_valuetype_decimal_expected.csv +2 -2
- data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_valuetype_string_expected.csv +2 -2
- data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/dt/config_1.yml +0 -1
- data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/dt/config_2.yml +0 -1
- data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/ts/config_1.yml +0 -1
- data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/ts/config_2.yml +0 -1
- metadata +5 -5
- data/classpath/embulk-input-jdbc-0.8.1.jar +0 -0
- data/classpath/embulk-input-mysql-0.8.1.jar +0 -0
- data/classpath/mysql-connector-java-5.1.34.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b521bd3bf2c7c3af6fa853b40fc0bd7f683f2738
|
4
|
+
data.tar.gz: 4d57d69e285042efb51258bf07f8549d0c633f45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 638469a4ddaf6c601382e43747790e9aa7c39b8c61940605234dc5fe75ee784d2285c45f484f93ca0aa35ec16007b46a406b5c0b580d55c01a08d5a9dba72e02
|
7
|
+
data.tar.gz: fbd4b7a01f882844ef3d0efaabd6ea545fafaaaafbfa26167282d0f5da6085da720fad5c41a677d89a5b83e33c6a15068464a68d59f1b6c55470285e97791112
|
data/README.md
CHANGED
@@ -9,6 +9,7 @@ MySQL input plugin for Embulk loads records from MySQL.
|
|
9
9
|
|
10
10
|
## Configuration
|
11
11
|
|
12
|
+
- **driver_path**: path to the jar file of the MySQL JDBC driver. If not set, the bundled JDBC driver (MySQL Connector/J 5.1.44) will be used (string). NOTE: embulk-input-mysql 0.9.0 upgraded the bundled MySQL Connector/J version from 5.1.34 to 5.1.44 . And set useLegacyDatetimeCode=false by default in order to get correct datetime value when the server timezone and the client timezone are different. Set useLegacyDatetimeCode=true if you need to get datetime value same as older embulk-input-mysql.
|
12
13
|
- **host**: database host name (string, required)
|
13
14
|
- **port**: database port number (integer, 3306)
|
14
15
|
- **user**: database login user name (string, required)
|
@@ -38,6 +39,7 @@ MySQL input plugin for Embulk loads records from MySQL.
|
|
38
39
|
- **incremental_columns**: column names for incremental loading (array of strings, default: use primary keys)
|
39
40
|
- **last_record**: values of the last record for incremental loading (array of objects, default: load all records)
|
40
41
|
- **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`)
|
42
|
+
- **use_legacy_datetime_code**: recommended not to set the property (boolean, default: false). If true, embulk-output-mysql will get wrong datetime values when the server timezone and the client server timezone are different as older embulk-output-mysql did.
|
41
43
|
- **column_options**: advanced: a key-value pairs where key is a column name and value is options for the column.
|
42
44
|
- **value_type**: embulk get values from database as this value_type. Typically, the value_type determines `getXXX` method of `java.sql.PreparedStatement`.
|
43
45
|
(string, default: depends on the sql type of the column. Available values options are: `long`, `double`, `float`, `decimal`, `boolean`, `string`, `json`, `date`, `time`, `timestamp`)
|
@@ -71,7 +73,7 @@ At the next execution, when `last_record: ` is also set, this plugin generates a
|
|
71
73
|
SELECT * FROM (
|
72
74
|
...original query is here...
|
73
75
|
)
|
74
|
-
WHERE
|
76
|
+
WHERE updated_at > '2017-01-01 00:32:12' OR (updated_at = '2017-01-01 00:32:12' AND id > 5291)
|
75
77
|
ORDER BY updated_at, id
|
76
78
|
```
|
77
79
|
|
data/build.gradle
CHANGED
Binary file
|
Binary file
|
Binary file
|
@@ -4,14 +4,16 @@ import java.io.IOException;
|
|
4
4
|
import java.lang.reflect.Field;
|
5
5
|
import java.util.Properties;
|
6
6
|
import java.sql.Connection;
|
7
|
-
import java.sql.
|
7
|
+
import java.sql.DriverManager;
|
8
8
|
import java.sql.SQLException;
|
9
9
|
|
10
|
+
import com.google.common.base.Optional;
|
10
11
|
import com.google.common.base.Throwables;
|
11
|
-
|
12
|
+
|
12
13
|
import org.embulk.config.Config;
|
13
14
|
import org.embulk.config.ConfigDefault;
|
14
15
|
import org.embulk.input.jdbc.AbstractJdbcInputPlugin;
|
16
|
+
import org.embulk.input.jdbc.Ssl;
|
15
17
|
import org.embulk.input.jdbc.getter.ColumnGetterFactory;
|
16
18
|
import org.embulk.input.mysql.MySQLInputConnection;
|
17
19
|
import org.embulk.input.mysql.getter.MySQLColumnGetterFactory;
|
@@ -24,6 +26,10 @@ public class MySQLInputPlugin
|
|
24
26
|
public interface MySQLPluginTask
|
25
27
|
extends PluginTask
|
26
28
|
{
|
29
|
+
@Config("driver_path")
|
30
|
+
@ConfigDefault("null")
|
31
|
+
public Optional<String> getDriverPath();
|
32
|
+
|
27
33
|
@Config("host")
|
28
34
|
public String getHost();
|
29
35
|
|
@@ -40,6 +46,14 @@ public class MySQLInputPlugin
|
|
40
46
|
|
41
47
|
@Config("database")
|
42
48
|
public String getDatabase();
|
49
|
+
|
50
|
+
@Config("ssl")
|
51
|
+
@ConfigDefault("\"disable\"") // backward compatibility
|
52
|
+
public Ssl getSsl();
|
53
|
+
|
54
|
+
@Config("use_legacy_datetime_code")
|
55
|
+
@ConfigDefault("false")
|
56
|
+
public boolean getUseLegacyDatetimeCode();
|
43
57
|
}
|
44
58
|
|
45
59
|
@Override
|
@@ -53,6 +67,8 @@ public class MySQLInputPlugin
|
|
53
67
|
{
|
54
68
|
MySQLPluginTask t = (MySQLPluginTask) task;
|
55
69
|
|
70
|
+
loadDriver("com.mysql.jdbc.Driver", t.getDriverPath());
|
71
|
+
|
56
72
|
String url = String.format("jdbc:mysql://%s:%d/%s",
|
57
73
|
t.getHost(), t.getPort(), t.getDatabase());
|
58
74
|
|
@@ -60,7 +76,7 @@ public class MySQLInputPlugin
|
|
60
76
|
props.setProperty("user", t.getUser());
|
61
77
|
props.setProperty("password", t.getPassword());
|
62
78
|
|
63
|
-
// convert 0000-00-00 to NULL to avoid this
|
79
|
+
// convert 0000-00-00 to NULL to avoid this exception:
|
64
80
|
// java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date
|
65
81
|
props.setProperty("zeroDateTimeBehavior", "convertToNull");
|
66
82
|
|
@@ -73,21 +89,24 @@ public class MySQLInputPlugin
|
|
73
89
|
// Socket options TCP_KEEPCNT, TCP_KEEPIDLE, and TCP_KEEPINTVL are not configurable.
|
74
90
|
props.setProperty("tcpKeepAlive", "true");
|
75
91
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
92
|
+
switch (t.getSsl()) {
|
93
|
+
case DISABLE:
|
94
|
+
props.setProperty("useSSL", "false");
|
95
|
+
break;
|
96
|
+
case ENABLE:
|
97
|
+
props.setProperty("useSSL", "true");
|
98
|
+
props.setProperty("requireSSL", "true");
|
99
|
+
props.setProperty("verifyServerCertificate", "false");
|
100
|
+
break;
|
101
|
+
case VERIFY:
|
102
|
+
props.setProperty("useSSL", "true");
|
103
|
+
props.setProperty("requireSSL", "true");
|
104
|
+
props.setProperty("verifyServerCertificate", "true");
|
105
|
+
break;
|
106
|
+
}
|
107
|
+
|
108
|
+
// NOTE:The useLegacyDatetimeCode option is obsolete in the MySQL Connector/J 6.
|
109
|
+
props.setProperty("useLegacyDatetimeCode", String.valueOf(t.getUseLegacyDatetimeCode()));
|
91
110
|
|
92
111
|
if (t.getFetchRows() == 1) {
|
93
112
|
logger.info("Fetch size is 1. Fetching rows one by one.");
|
@@ -99,18 +118,12 @@ public class MySQLInputPlugin
|
|
99
118
|
}
|
100
119
|
|
101
120
|
props.putAll(t.getOptions());
|
121
|
+
logConnectionProperties(url, props);
|
102
122
|
|
103
123
|
// load timezone mappings
|
104
124
|
loadTimeZoneMappings();
|
105
125
|
|
106
|
-
|
107
|
-
try {
|
108
|
-
driver = new com.mysql.jdbc.Driver(); // new com.mysql.jdbc.Driver throws SQLException
|
109
|
-
} catch (SQLException ex) {
|
110
|
-
throw new RuntimeException(ex);
|
111
|
-
}
|
112
|
-
|
113
|
-
Connection con = driver.connect(url, props);
|
126
|
+
Connection con = DriverManager.getConnection(url, props);
|
114
127
|
try {
|
115
128
|
MySQLInputConnection c = new MySQLInputConnection(con);
|
116
129
|
con = null;
|
@@ -142,19 +155,20 @@ public class MySQLInputPlugin
|
|
142
155
|
// Here implements a workaround as as workaround.
|
143
156
|
Field f = null;
|
144
157
|
try {
|
145
|
-
|
158
|
+
Class<?> timeUtilClass = Class.forName("com.mysql.jdbc.TimeUtil");
|
159
|
+
f = timeUtilClass.getDeclaredField("timeZoneMappings");
|
146
160
|
f.setAccessible(true);
|
147
161
|
|
148
162
|
Properties timeZoneMappings = (Properties) f.get(null);
|
149
163
|
if (timeZoneMappings == null) {
|
150
164
|
timeZoneMappings = new Properties();
|
151
|
-
synchronized (
|
165
|
+
synchronized (timeUtilClass) {
|
152
166
|
timeZoneMappings.load(this.getClass().getResourceAsStream("/com/mysql/jdbc/TimeZoneMapping.properties"));
|
153
167
|
}
|
154
168
|
f.set(null, timeZoneMappings);
|
155
169
|
}
|
156
170
|
}
|
157
|
-
catch (IllegalAccessException | NoSuchFieldException | IOException e) {
|
171
|
+
catch (ClassNotFoundException | IllegalAccessException | NoSuchFieldException | IOException e) {
|
158
172
|
throw Throwables.propagate(e);
|
159
173
|
}
|
160
174
|
finally {
|
@@ -163,4 +177,5 @@ public class MySQLInputPlugin
|
|
163
177
|
}
|
164
178
|
}
|
165
179
|
}
|
180
|
+
|
166
181
|
}
|
@@ -1,14 +1,13 @@
|
|
1
1
|
package org.embulk.input.mysql;
|
2
2
|
|
3
3
|
import java.util.List;
|
4
|
+
import java.lang.reflect.Method;
|
4
5
|
import java.sql.Connection;
|
5
6
|
import java.sql.PreparedStatement;
|
6
7
|
import java.sql.SQLException;
|
7
8
|
import java.sql.ResultSet;
|
8
9
|
import java.util.TimeZone;
|
9
10
|
|
10
|
-
import com.mysql.jdbc.ConnectionImpl;
|
11
|
-
import com.mysql.jdbc.ConnectionProperties;
|
12
11
|
import org.embulk.input.jdbc.JdbcInputConnection;
|
13
12
|
import org.embulk.input.jdbc.JdbcLiteral;
|
14
13
|
import org.embulk.input.jdbc.getter.ColumnGetter;
|
@@ -52,11 +51,33 @@ public class MySQLInputConnection
|
|
52
51
|
|
53
52
|
public boolean getUseLegacyDatetimeCode()
|
54
53
|
{
|
55
|
-
|
54
|
+
try {
|
55
|
+
Class<?> connectionPropertiesClass = Class.forName("com.mysql.jdbc.ConnectionProperties");
|
56
|
+
Method getUseLegacyDatetimeCodeMethod = connectionPropertiesClass.getMethod("getUseLegacyDatetimeCode");
|
57
|
+
return (Boolean)getUseLegacyDatetimeCodeMethod.invoke(connection);
|
58
|
+
|
59
|
+
} catch (Exception e) {
|
60
|
+
throw new RuntimeException(e);
|
61
|
+
}
|
56
62
|
}
|
57
63
|
|
58
64
|
public TimeZone getServerTimezoneTZ()
|
59
65
|
{
|
60
|
-
|
66
|
+
try {
|
67
|
+
Class<?> connectionImplClass = Class.forName("com.mysql.jdbc.ConnectionImpl");
|
68
|
+
Method getServerTimezoneTZMethod = connectionImplClass.getMethod("getServerTimezoneTZ");
|
69
|
+
return (TimeZone)getServerTimezoneTZMethod.invoke(connection);
|
70
|
+
|
71
|
+
} catch (Exception e) {
|
72
|
+
throw new RuntimeException(e);
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
@Override
|
77
|
+
public void showDriverVersion() throws SQLException {
|
78
|
+
super.showDriverVersion();
|
79
|
+
logger.warn("embulk-input-mysql 0.9.0 upgraded the bundled MySQL Connector/J version from 5.1.34 to 5.1.44 .");
|
80
|
+
logger.warn("And set useLegacyDatetimeCode=false by default in order to get correct datetime value when the server timezone and the client timezone are different.");
|
81
|
+
logger.warn("Set useLegacyDatetimeCode=true if you need to get datetime value same as older embulk-input-mysql.");
|
61
82
|
}
|
62
83
|
}
|
data/src/main/java/org/embulk/input/mysql/getter/AbstractMySQLTimestampIncrementalHandler.java
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
package org.embulk.input.mysql.getter;
|
2
2
|
|
3
3
|
import com.fasterxml.jackson.databind.JsonNode;
|
4
|
+
import com.google.common.base.Optional;
|
5
|
+
import org.embulk.config.ConfigSource;
|
6
|
+
import org.embulk.config.Task;
|
4
7
|
import org.embulk.input.jdbc.getter.AbstractIncrementalHandler;
|
5
8
|
import org.embulk.input.jdbc.getter.ColumnGetter;
|
6
9
|
import org.embulk.spi.Column;
|
7
10
|
import org.embulk.spi.Exec;
|
8
11
|
import org.embulk.spi.time.TimestampFormatter;
|
9
|
-
import org.embulk.spi.time.TimestampFormatter.FormatterTask;
|
10
12
|
import org.embulk.spi.time.TimestampParser;
|
11
|
-
import org.embulk.spi.time.TimestampParser.ParserTask;
|
12
13
|
import org.joda.time.DateTimeZone;
|
13
14
|
|
14
15
|
import java.sql.PreparedStatement;
|
@@ -42,13 +43,20 @@ public abstract class AbstractMySQLTimestampIncrementalHandler
|
|
42
43
|
super.getAndSet(from, fromIndex, toColumn);
|
43
44
|
}
|
44
45
|
|
46
|
+
private static interface FormatterIntlTask extends Task, TimestampFormatter.Task {}
|
47
|
+
private static interface FormatterIntlColumnOption extends Task, TimestampFormatter.TimestampColumnOption {}
|
48
|
+
|
45
49
|
@Override
|
46
50
|
public JsonNode encodeToJson()
|
47
51
|
{
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
+
// TODO: Switch to a newer TimestampFormatter constructor after a reasonable interval.
|
53
|
+
// Traditional constructor is used here for compatibility.
|
54
|
+
final ConfigSource configSource = Exec.newConfigSource();
|
55
|
+
configSource.set("format", getTimestampFormat());
|
56
|
+
configSource.set("timezone", "UTC");
|
57
|
+
TimestampFormatter formatter = new TimestampFormatter(
|
58
|
+
Exec.newConfigSource().loadConfig(FormatterIntlTask.class),
|
59
|
+
Optional.fromNullable(configSource.loadConfig(FormatterIntlColumnOption.class)));
|
52
60
|
String text = formatter.format(utcTimestampFromSessionTime(epochSecond, nano));
|
53
61
|
return jsonNodeFactory.textNode(text);
|
54
62
|
}
|
@@ -57,14 +65,21 @@ public abstract class AbstractMySQLTimestampIncrementalHandler
|
|
57
65
|
|
58
66
|
protected abstract org.embulk.spi.time.Timestamp utcTimestampFromSessionTime(long epochSecond, int nano);
|
59
67
|
|
68
|
+
private static interface ParserIntlTask extends Task, TimestampParser.Task {}
|
69
|
+
private static interface ParserIntlColumnOption extends Task, TimestampParser.TimestampColumnOption {}
|
70
|
+
|
60
71
|
@Override
|
61
72
|
public void decodeFromJsonTo(PreparedStatement toStatement, int toIndex, JsonNode fromValue)
|
62
73
|
throws SQLException
|
63
74
|
{
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
75
|
+
// TODO: Switch to a newer TimestampParser constructor after a reasonable interval.
|
76
|
+
// Traditional constructor is used here for compatibility.
|
77
|
+
final ConfigSource configSource = Exec.newConfigSource();
|
78
|
+
configSource.set("format", getTimestampPattern());
|
79
|
+
configSource.set("timezone", "UTC");
|
80
|
+
TimestampParser parser = new TimestampParser(
|
81
|
+
Exec.newConfigSource().loadConfig(ParserIntlTask.class),
|
82
|
+
configSource.loadConfig(ParserIntlColumnOption.class));
|
68
83
|
org.embulk.spi.time.Timestamp epoch = parser.parse(fromValue.asText());
|
69
84
|
toStatement.setTimestamp(toIndex, utcTimestampToSessionTime(epoch));
|
70
85
|
}
|
data/src/main/java/org/embulk/input/mysql/getter/MySQLTimestampTimestampIncrementalHandler.java
CHANGED
@@ -22,8 +22,7 @@ public class MySQLTimestampTimestampIncrementalHandler
|
|
22
22
|
@Override
|
23
23
|
public org.embulk.spi.time.Timestamp utcTimestampFromSessionTime(long epochSecond, int nano)
|
24
24
|
{
|
25
|
-
|
26
|
-
return org.embulk.spi.time.Timestamp.ofEpochSecond(sec, nano);
|
25
|
+
return org.embulk.spi.time.Timestamp.ofEpochSecond(epochSecond, nano);
|
27
26
|
}
|
28
27
|
|
29
28
|
@Override
|
@@ -1,2 +1,2 @@
|
|
1
|
-
10,,,,,,,,,,,,,2015-06-04
|
2
|
-
11,true,true,false,false,true,true,false,true,,,2015-06-03 21:00:00.000000 +0000,2015-06-04
|
1
|
+
10,,,,,,,,,,,,,2015-06-04 23:45:06.000000 +0000,,
|
2
|
+
11,true,true,false,false,true,true,false,true,,,2015-06-03 21:00:00.000000 +0000,2015-06-04 12:34:56.000000 +0000,2015-06-04 23:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-04 01:02:03.123456 +0000
|
@@ -1,2 +1,2 @@
|
|
1
|
-
10,,,,,,,,,,,,,2015-06-04
|
2
|
-
11,99.0,9999.0,-9.9999999E7,-1.0E16,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678.0,,2015-06-03 21:00:00.000000 +0000,2015-06-04
|
1
|
+
10,,,,,,,,,,,,,2015-06-04 23:45:06.000000 +0000,,
|
2
|
+
11,99.0,9999.0,-9.9999999E7,-1.0E16,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678.0,,2015-06-03 21:00:00.000000 +0000,2015-06-04 12:34:56.000000 +0000,2015-06-04 23:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-04 01:02:03.123456 +0000
|
@@ -1,2 +1,2 @@
|
|
1
|
-
10,,,,,,,,,,,,,2015-06-04
|
2
|
-
11,99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015-06-03 21:00:00.000000 +0000,2015-06-04
|
1
|
+
10,,,,,,,,,,,,,2015-06-04 23:45:06.000000 +0000,,
|
2
|
+
11,99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015-06-03 21:00:00.000000 +0000,2015-06-04 12:34:56.000000 +0000,2015-06-04 23:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-04 01:02:03.123456 +0000
|
@@ -1,2 +1,2 @@
|
|
1
|
-
10,,,,,,,,,,,,,2015-06-04
|
2
|
-
11,99,9999,-99999999,-9999999999999999,1,1,-1234,123456789012345678,5678,,2015-06-03 21:00:00.000000 +0000,2015-06-04
|
1
|
+
10,,,,,,,,,,,,,2015-06-04 23:45:06.000000 +0000,,
|
2
|
+
11,99,9999,-99999999,-9999999999999999,1,1,-1234,123456789012345678,5678,,2015-06-03 21:00:00.000000 +0000,2015-06-04 12:34:56.000000 +0000,2015-06-04 23:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-04 01:02:03.123456 +0000
|
@@ -1,2 +1,2 @@
|
|
1
|
-
10,,,,,,,,,,,,,2015-06-04
|
2
|
-
11,99,9999,-99999999,-9999999999999999,1.2345,1.234567890123,-1234,123456789012345678.12,5678,xy,2015-06-03 21:00:00.000000 +0000,2015-06-04
|
1
|
+
10,,,,,,,,,,,,,2015-06-04 23:45:06.000000 +0000,,
|
2
|
+
11,99,9999,-99999999,-9999999999999999,1.2345,1.234567890123,-1234,123456789012345678.12,5678,xy,2015-06-03 21:00:00.000000 +0000,2015-06-04 12:34:56.000000 +0000,2015-06-04 23:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-04 01:02:03.123456 +0000
|
data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp1_expected.csv
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
10,,,,,,,,,,,,,2015-06-04
|
2
|
-
11,99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015-06-03 21:00:00.000000 +0000,2015-06-04
|
1
|
+
10,,,,,,,,,,,,,2015-06-04 23:45:06.000000 +0000,,
|
2
|
+
11,99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015-06-03 21:00:00.000000 +0000,2015-06-04 12:34:56.000000 +0000,2015-06-04 23:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-04 01:02:03.123456 +0000
|
data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp2_expected.csv
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
10,,,,,,,,,,,,,2015/06/05
|
2
|
-
11,99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015/06/03,2015/06/04
|
1
|
+
10,,,,,,,,,,,,,2015/06/05 08:45:06,,
|
2
|
+
11,99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015/06/03,2015/06/04 12:34:56,2015/06/05 08:45:06,15-04-02,2015/06/04 01:02:03.123456
|
data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp3_expected.csv
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
10,,,,,,,,,,,,,2015/06/05
|
2
|
-
11,99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015/06/04,2015/06/04
|
1
|
+
10,,,,,,,,,,,,,2015/06/05 08:45:06,,
|
2
|
+
11,99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015/06/04,2015/06/04 21:34:56,2015/06/05 08:45:06,09-04-02,2015/06/04 10:02:03.123456
|
data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_valuetype_decimal_expected.csv
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
10,,,,,,,,,,,,,2015-06-04
|
2
|
-
11,99.0,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015-06-03 21:00:00.000000 +0000,2015-06-04
|
1
|
+
10,,,,,,,,,,,,,2015-06-04 23:45:06.000000 +0000,,
|
2
|
+
11,99.0,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015-06-03 21:00:00.000000 +0000,2015-06-04 12:34:56.000000 +0000,2015-06-04 23:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-04 01:02:03.123456 +0000
|
data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_valuetype_string_expected.csv
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
10,,,,,,,,,,,,,2015-06-04
|
2
|
-
11,99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015-06-03 21:00:00.000000 +0000,2015-06-04
|
1
|
+
10,,,,,,,,,,,,,2015-06-04 23:45:06.000000 +0000,,
|
2
|
+
11,99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015-06-03 21:00:00.000000 +0000,2015-06-04 12:34:56.000000 +0000,2015-06-04 23:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-04 01:02:03.123456 +0000
|
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.
|
4
|
+
version: 0.9.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: 2017-
|
11
|
+
date: 2017-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Selects records from a table.
|
14
14
|
email:
|
@@ -19,9 +19,9 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- README.md
|
21
21
|
- build.gradle
|
22
|
-
- classpath/embulk-input-jdbc-0.
|
23
|
-
- classpath/embulk-input-mysql-0.
|
24
|
-
-
|
22
|
+
- classpath/embulk-input-jdbc-0.9.0.jar
|
23
|
+
- classpath/embulk-input-mysql-0.9.0.jar
|
24
|
+
- default_jdbc_driver/mysql-connector-java-5.1.44.jar
|
25
25
|
- lib/embulk/input/mysql.rb
|
26
26
|
- src/main/java/org/embulk/input/MySQLInputPlugin.java
|
27
27
|
- src/main/java/org/embulk/input/mysql/MySQLInputConnection.java
|
Binary file
|
Binary file
|
Binary file
|