embulk-input-mysql 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -0
  3. data/build.gradle +1 -2
  4. data/classpath/embulk-input-jdbc-0.8.1.jar +0 -0
  5. data/classpath/embulk-input-mysql-0.8.1.jar +0 -0
  6. data/src/main/java/org/embulk/input/MySQLInputPlugin.java +54 -0
  7. data/src/main/java/org/embulk/input/mysql/MySQLInputConnection.java +14 -0
  8. data/src/main/java/org/embulk/input/mysql/getter/AbstractMySQLTimestampIncrementalHandler.java +75 -0
  9. data/src/main/java/org/embulk/input/mysql/getter/MySQLColumnGetterFactory.java +61 -0
  10. data/src/main/java/org/embulk/input/mysql/getter/MySQLDateTimeTimestampIncrementalHandler.java +45 -0
  11. data/src/main/java/org/embulk/input/mysql/getter/MySQLTimestampTimestampIncrementalHandler.java +42 -0
  12. data/src/test/java/org/embulk/input/mysql/BasicTest.java +137 -0
  13. data/src/test/java/org/embulk/input/mysql/IncrementalTest.java +107 -0
  14. data/src/test/java/org/embulk/input/mysql/MySQLTests.java +55 -0
  15. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/setup.sql +65 -0
  16. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_boolean_config.yml +13 -0
  17. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_boolean_expected.csv +2 -0
  18. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_boolean_expected.diff +2 -0
  19. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_config.yml +2 -0
  20. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_double_config.yml +13 -0
  21. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_double_expected.csv +2 -0
  22. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_double_expected.diff +2 -0
  23. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_expected.csv +2 -0
  24. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_expected.diff +2 -0
  25. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_long_config.yml +13 -0
  26. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_long_expected.csv +2 -0
  27. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_long_expected.diff +2 -0
  28. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_string_config.yml +13 -0
  29. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_string_expected.csv +2 -0
  30. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_string_expected.diff +2 -0
  31. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp1_config.yml +13 -0
  32. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp1_expected.csv +2 -0
  33. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp1_expected.diff +2 -0
  34. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp2_config.yml +8 -0
  35. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp2_expected.csv +2 -0
  36. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp2_expected.diff +2 -0
  37. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp3_config.yml +9 -0
  38. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp3_expected.csv +2 -0
  39. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_timestamp3_expected.diff +2 -0
  40. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_valuetype_decimal_config.yml +3 -0
  41. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_valuetype_decimal_expected.csv +2 -0
  42. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_valuetype_decimal_expected.diff +2 -0
  43. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_valuetype_string_config.yml +3 -0
  44. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_valuetype_string_expected.csv +2 -0
  45. data/src/test/resources/org/embulk/input/mysql/test/expect/basic/test_valuetype_string_expected.diff +2 -0
  46. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/dt/config_1.yml +5 -0
  47. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/dt/config_2.yml +5 -0
  48. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/dt/expected_1.csv +7 -0
  49. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/dt/expected_1.diff +3 -0
  50. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/dt/expected_2.csv +3 -0
  51. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/dt/expected_2.diff +3 -0
  52. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/dt/insert_more.sql +9 -0
  53. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/dt/setup.sql +16 -0
  54. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/int/config_1.yml +3 -0
  55. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/int/config_2.yml +4 -0
  56. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/int/expected_1.csv +4 -0
  57. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/int/expected_1.diff +3 -0
  58. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/int/expected_2.csv +2 -0
  59. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/int/expected_2.diff +3 -0
  60. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/int/insert_more.sql +7 -0
  61. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/int/setup.sql +13 -0
  62. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/ts/config_1.yml +5 -0
  63. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/ts/config_2.yml +5 -0
  64. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/ts/expected_1.csv +7 -0
  65. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/ts/expected_1.diff +3 -0
  66. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/ts/expected_2.csv +3 -0
  67. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/ts/expected_2.diff +3 -0
  68. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/ts/insert_more.sql +10 -0
  69. data/src/test/resources/org/embulk/input/mysql/test/expect/incremental/ts/setup.sql +18 -0
  70. metadata +66 -15
  71. data/classpath/embulk-input-jdbc-0.8.0.jar +0 -0
  72. data/classpath/embulk-input-mysql-0.8.0.jar +0 -0
  73. data/src/test/java/org/embulk/input/mysql/MySQLInputPluginTest.java +0 -242
  74. data/src/test/resources/mysql/yml/input-boolean.yml +0 -33
  75. data/src/test/resources/mysql/yml/input-double.yml +0 -33
  76. data/src/test/resources/mysql/yml/input-long.yml +0 -33
  77. data/src/test/resources/mysql/yml/input-string.yml +0 -33
  78. data/src/test/resources/mysql/yml/input-timestamp1.yml +0 -33
  79. data/src/test/resources/mysql/yml/input-timestamp2.yml +0 -22
  80. data/src/test/resources/mysql/yml/input-timestamp3.yml +0 -23
  81. data/src/test/resources/mysql/yml/input-valuetype-decimal.yml +0 -17
  82. data/src/test/resources/mysql/yml/input-valuetype-string.yml +0 -17
  83. data/src/test/resources/mysql/yml/input.yml +0 -22
@@ -0,0 +1,107 @@
1
+ package org.embulk.input.mysql;
2
+
3
+ import org.embulk.config.ConfigDiff;
4
+ import org.embulk.config.ConfigSource;
5
+ import org.embulk.input.MySQLInputPlugin;
6
+ import org.embulk.spi.InputPlugin;
7
+ import org.embulk.test.EmbulkTests;
8
+ import org.embulk.test.TestingEmbulk;
9
+ import org.embulk.test.TestingEmbulk.RunResult;
10
+ import org.junit.Before;
11
+ import org.junit.Rule;
12
+ import org.junit.Test;
13
+
14
+ import java.nio.file.Path;
15
+
16
+ import static org.embulk.input.mysql.MySQLTests.execute;
17
+ import static org.embulk.test.EmbulkTests.readSortedFile;
18
+ import static org.hamcrest.Matchers.is;
19
+ import static org.junit.Assert.assertThat;
20
+
21
+ public class IncrementalTest
22
+ {
23
+ private static final String BASIC_RESOURCE_PATH = "org/embulk/input/mysql/test/expect/incremental/";
24
+
25
+ private static ConfigSource loadYamlResource(TestingEmbulk embulk, String fileName)
26
+ {
27
+ return embulk.loadYamlResource(BASIC_RESOURCE_PATH + fileName);
28
+ }
29
+
30
+ private static String readResource(String fileName)
31
+ {
32
+ return EmbulkTests.readResource(BASIC_RESOURCE_PATH + fileName);
33
+ }
34
+
35
+ @Rule
36
+ public TestingEmbulk embulk = TestingEmbulk.builder()
37
+ .registerPlugin(InputPlugin.class, "mysql", MySQLInputPlugin.class)
38
+ .build();
39
+
40
+ private ConfigSource baseConfig;
41
+
42
+ @Before
43
+ public void setup()
44
+ {
45
+ baseConfig = MySQLTests.baseConfig();
46
+ }
47
+
48
+ @Test
49
+ public void testInt() throws Exception
50
+ {
51
+ // setup first rows
52
+ execute(readResource("int/setup.sql"));
53
+
54
+ Path out1 = embulk.createTempFile("csv");
55
+ RunResult result1 = embulk.runInput(baseConfig.merge(loadYamlResource(embulk, "int/config_1.yml")), out1);
56
+ assertThat(readSortedFile(out1), is(readResource("int/expected_1.csv")));
57
+ assertThat(result1.getConfigDiff(), is((ConfigDiff) loadYamlResource(embulk, "int/expected_1.diff")));
58
+
59
+ // insert more rows
60
+ execute(readResource("int/insert_more.sql"));
61
+
62
+ Path out2 = embulk.createTempFile("csv");
63
+ RunResult result2 = embulk.runInput(baseConfig.merge(loadYamlResource(embulk, "int/config_2.yml")), out2);
64
+ assertThat(readSortedFile(out2), is(readResource("int/expected_2.csv")));
65
+ assertThat(result2.getConfigDiff(), is((ConfigDiff) loadYamlResource(embulk, "int/expected_2.diff")));
66
+ }
67
+
68
+ @Test
69
+ public void testDateTime() throws Exception
70
+ {
71
+ // setup first rows
72
+ execute(readResource("dt/setup.sql"));
73
+
74
+ Path out1 = embulk.createTempFile("csv");
75
+ RunResult result1 = embulk.runInput(baseConfig.merge(loadYamlResource(embulk, "dt/config_1.yml")), out1);
76
+ assertThat(readSortedFile(out1), is(readResource("dt/expected_1.csv")));
77
+ assertThat(result1.getConfigDiff(), is((ConfigDiff) loadYamlResource(embulk, "dt/expected_1.diff")));
78
+
79
+ // insert more rows
80
+ execute(readResource("dt/insert_more.sql"));
81
+
82
+ Path out2 = embulk.createTempFile("csv");
83
+ RunResult result2 = embulk.runInput(baseConfig.merge(loadYamlResource(embulk, "dt/config_2.yml")), out2);
84
+ assertThat(readSortedFile(out2), is(readResource("dt/expected_2.csv")));
85
+ assertThat(result2.getConfigDiff(), is((ConfigDiff) loadYamlResource(embulk, "dt/expected_2.diff")));
86
+ }
87
+
88
+ @Test
89
+ public void testTimestamp() throws Exception
90
+ {
91
+ // setup first rows
92
+ execute(readResource("ts/setup.sql"));
93
+
94
+ Path out1 = embulk.createTempFile("csv");
95
+ RunResult result1 = embulk.runInput(baseConfig.merge(loadYamlResource(embulk, "ts/config_1.yml")), out1);
96
+ assertThat(readSortedFile(out1), is(readResource("ts/expected_1.csv")));
97
+ assertThat(result1.getConfigDiff(), is((ConfigDiff) loadYamlResource(embulk, "ts/expected_1.diff")));
98
+
99
+ // insert more rows
100
+ execute(readResource("ts/insert_more.sql"));
101
+
102
+ Path out2 = embulk.createTempFile("csv");
103
+ RunResult result2 = embulk.runInput(baseConfig.merge(loadYamlResource(embulk, "ts/config_2.yml")), out2);
104
+ assertThat(readSortedFile(out2), is(readResource("ts/expected_2.csv")));
105
+ assertThat(result2.getConfigDiff(), is((ConfigDiff) loadYamlResource(embulk, "ts/expected_2.diff")));
106
+ }
107
+ }
@@ -0,0 +1,55 @@
1
+ package org.embulk.input.mysql;
2
+
3
+ import com.google.common.base.Throwables;
4
+ import com.google.common.collect.ImmutableList;
5
+ import com.google.common.io.ByteStreams;
6
+ import org.embulk.config.ConfigSource;
7
+ import org.embulk.test.EmbulkTests;
8
+
9
+ import java.io.IOException;
10
+
11
+ import static java.util.Locale.ENGLISH;
12
+
13
+ public class MySQLTests
14
+ {
15
+ public static ConfigSource baseConfig()
16
+ {
17
+ return EmbulkTests.config("EMBULK_INPUT_MYSQL_TEST_CONFIG");
18
+ }
19
+
20
+ public static void execute(String sql)
21
+ {
22
+ ConfigSource config = baseConfig();
23
+
24
+ ImmutableList.Builder<String> args = ImmutableList.builder();
25
+ args.add("mysql")
26
+ .add("-u")
27
+ .add(config.get(String.class, "user"));
28
+ if (!config.get(String.class, "password").isEmpty()) {
29
+ args.add("-p" + config.get(String.class, "password"));
30
+ }
31
+ args
32
+ .add("-h")
33
+ .add(config.get(String.class, "host"))
34
+ .add("-P")
35
+ .add(config.get(String.class, "port", "3306"))
36
+ .add(config.get(String.class, "database"))
37
+ .add("-e")
38
+ .add(sql);
39
+
40
+ ProcessBuilder pb = new ProcessBuilder(args.build());
41
+ pb.redirectErrorStream(true);
42
+ int code;
43
+ try {
44
+ Process process = pb.start();
45
+ ByteStreams.copy(process.getInputStream(), System.out);
46
+ code = process.waitFor();
47
+ } catch (IOException | InterruptedException ex) {
48
+ throw Throwables.propagate(ex);
49
+ }
50
+ if (code != 0) {
51
+ throw new RuntimeException(String.format(ENGLISH,
52
+ "Command finished with non-zero exit code. Exit code is %d.", code));
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,65 @@
1
+ drop table if exists test1;
2
+
3
+ create table test1 (
4
+ id char(2),
5
+ c1 tinyint,
6
+ c2 smallint,
7
+ c3 int,
8
+ c4 bigint,
9
+ c5 float,
10
+ c6 double,
11
+ c7 decimal(4,0),
12
+ c8 decimal(20,2),
13
+ c9 char(4),
14
+ c10 varchar(4),
15
+ c11 date,
16
+ c12 datetime,
17
+ c13 timestamp,
18
+ c14 time,
19
+ c15 datetime(6),
20
+ primary key(id)
21
+ );
22
+
23
+ insert into test1 values(
24
+ '10',
25
+ null,
26
+ null,
27
+ null,
28
+ null,
29
+ null,
30
+ null,
31
+ null,
32
+ null,
33
+ null,
34
+ null,
35
+ null,
36
+ null,
37
+ '2015-06-04 23:45:06',
38
+ null,
39
+ null
40
+ );
41
+
42
+ insert into test1 values(
43
+ '11',
44
+ 99,
45
+ 9999,
46
+ -99999999,
47
+ -9999999999999999,
48
+ 1.2345,
49
+ 1.234567890123,
50
+ -1234,
51
+ 123456789012345678.12,
52
+ '5678',
53
+ 'xy',
54
+ '2015-06-04',
55
+ '2015-06-04 12:34:56',
56
+ '2015-06-04 23:45:06',
57
+ '08:04:02',
58
+ '2015-06-04 01:02:03.123456'
59
+ );
60
+
61
+ drop table if exists test2;
62
+
63
+ create table test2 (c1 bigint unsigned);
64
+
65
+ insert into test2 values(18446744073709551615);
@@ -0,0 +1,13 @@
1
+ table: test1
2
+ order_by: 'id'
3
+ column_options:
4
+ c1: {type: boolean}
5
+ c2: {type: boolean}
6
+ c3: {type: boolean}
7
+ c4: {type: boolean}
8
+ c5: {type: boolean}
9
+ c6: {type: boolean}
10
+ c7: {type: boolean}
11
+ c8: {type: boolean}
12
+ c9: {type: boolean}
13
+ c10: {type: boolean}
@@ -0,0 +1,2 @@
1
+ 10,,,,,,,,,,,,,2015-06-04 20: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 09:34:56.000000 +0000,2015-06-04 20:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-03 22:02:03.123456 +0000
@@ -0,0 +1,2 @@
1
+ table: test1
2
+ order_by: 'id'
@@ -0,0 +1,13 @@
1
+ table: test1
2
+ order_by: 'id'
3
+ column_options:
4
+ c1: {type: double}
5
+ c2: {type: double}
6
+ c3: {type: double}
7
+ c4: {type: double}
8
+ c5: {type: double}
9
+ c6: {type: double}
10
+ c7: {type: double}
11
+ c8: {type: double}
12
+ c9: {type: double}
13
+ c10: {type: double}
@@ -0,0 +1,2 @@
1
+ 10,,,,,,,,,,,,,2015-06-04 20: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 09:34:56.000000 +0000,2015-06-04 20:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-03 22:02:03.123456 +0000
@@ -0,0 +1,2 @@
1
+ 10,,,,,,,,,,,,,2015-06-04 20: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 09:34:56.000000 +0000,2015-06-04 20:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-03 22:02:03.123456 +0000
@@ -0,0 +1,13 @@
1
+ table: test1
2
+ order_by: 'id'
3
+ column_options:
4
+ c1: {type: long}
5
+ c2: {type: long}
6
+ c3: {type: long}
7
+ c4: {type: long}
8
+ c5: {type: long}
9
+ c6: {type: long}
10
+ c7: {type: long}
11
+ c8: {type: long}
12
+ c9: {type: long}
13
+ c10: {type: long}
@@ -0,0 +1,2 @@
1
+ 10,,,,,,,,,,,,,2015-06-04 20: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 09:34:56.000000 +0000,2015-06-04 20:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-03 22:02:03.123456 +0000
@@ -0,0 +1,13 @@
1
+ table: test1
2
+ order_by: 'id'
3
+ column_options:
4
+ c1: {type: string}
5
+ c2: {type: string}
6
+ c3: {type: string}
7
+ c4: {type: string}
8
+ c5: {type: string}
9
+ c6: {type: string}
10
+ c7: {type: string}
11
+ c8: {type: string}
12
+ c9: {type: string}
13
+ c10: {type: string}
@@ -0,0 +1,2 @@
1
+ 10,,,,,,,,,,,,,2015-06-04 20: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 09:34:56.000000 +0000,2015-06-04 20:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-03 22:02:03.123456 +0000
@@ -0,0 +1,13 @@
1
+ table: test1
2
+ order_by: 'id'
3
+ column_options:
4
+ #c11: {type: timestamp, timestamp_format: '%Y/%m/%d'}
5
+ #c12: {type: timestamp, timestamp_format: '%Y/%m/%d %H:%M:%S'}
6
+ #c13: {type: timestamp, timestamp_format: '%Y/%m/%d %H:%M:%S', timezone: '+0900'}
7
+ #c14: {type: timestamp, timestamp_format: '%H-%M-%S', timezone: '+0900'}
8
+ #c15: {type: timestamp, timestamp_format: '%Y/%m/%d %H:%M:%S.%6N'}
9
+ c11: {type: timestamp}
10
+ c12: {type: timestamp}
11
+ c13: {type: timestamp}
12
+ c14: {type: timestamp}
13
+ c15: {type: timestamp}
@@ -0,0 +1,2 @@
1
+ 10,,,,,,,,,,,,,2015-06-04 20: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 09:34:56.000000 +0000,2015-06-04 20:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-03 22:02:03.123456 +0000
@@ -0,0 +1,8 @@
1
+ table: test1
2
+ order_by: 'id'
3
+ column_options:
4
+ c11: {type: string, timestamp_format: '%Y/%m/%d'}
5
+ c12: {type: string, timestamp_format: '%Y/%m/%d %H:%M:%S'}
6
+ c13: {type: string, timestamp_format: '%Y/%m/%d %H:%M:%S', timezone: '+0900'}
7
+ c14: {type: string, timestamp_format: '%H-%M-%S', timezone: '+0900'}
8
+ c15: {type: string, timestamp_format: '%Y/%m/%d %H:%M:%S.%6N'}
@@ -0,0 +1,2 @@
1
+ 10,,,,,,,,,,,,,2015/06/05 05:45:06,,
2
+ 11,99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015/06/03,2015/06/04 09:34:56,2015/06/05 05:45:06,15-04-02,2015/06/03 22:02:03.123456
@@ -0,0 +1,9 @@
1
+ table: test1
2
+ order_by: 'id'
3
+ default_timezone: '+0900'
4
+ column_options:
5
+ c11: {type: string, timestamp_format: '%Y/%m/%d'}
6
+ c12: {type: string, timestamp_format: '%Y/%m/%d %H:%M:%S'}
7
+ c13: {type: string, timestamp_format: '%Y/%m/%d %H:%M:%S'}
8
+ c14: {type: string, timestamp_format: '%H-%M-%S', timezone: '+0300'}
9
+ c15: {type: string, timestamp_format: '%Y/%m/%d %H:%M:%S.%6N'}
@@ -0,0 +1,2 @@
1
+ 10,,,,,,,,,,,,,2015/06/05 05:45:06,,
2
+ 11,99,9999,-99999999,-9999999999999999,1.2345000505447388,1.234567890123,-1234.0,1.2345678901234568E17,5678,xy,2015/06/04,2015/06/04 18:34:56,2015/06/05 05:45:06,09-04-02,2015/06/04 07:02:03.123456
@@ -0,0 +1,3 @@
1
+ table: test1
2
+ column_options:
3
+ c1: {value_type: decimal}
@@ -0,0 +1,2 @@
1
+ 10,,,,,,,,,,,,,2015-06-04 20: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 09:34:56.000000 +0000,2015-06-04 20:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-03 22:02:03.123456 +0000
@@ -0,0 +1,3 @@
1
+ table: test1
2
+ column_options:
3
+ c1: {value_type: string}
@@ -0,0 +1,2 @@
1
+ 10,,,,,,,,,,,,,2015-06-04 20: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 09:34:56.000000 +0000,2015-06-04 20:45:06.000000 +0000,1970-01-01 06:04:02.000000 +0000,2015-06-03 22:02:03.123456 +0000
@@ -0,0 +1,5 @@
1
+ table: dt_load
2
+ default_time_zone: +0300 # should be ignored
3
+ options: {useLegacyDatetimeCode: false}
4
+ incremental: true
5
+ incremental_columns: [time]
@@ -0,0 +1,5 @@
1
+ table: dt_load
2
+ options: {useLegacyDatetimeCode: false}
3
+ last_record: ['2016-11-02T04:00:05.333003']
4
+ incremental: true
5
+ incremental_columns: [time]
@@ -0,0 +1,7 @@
1
+ 2016-11-02 01:00:01.000000 +0000,first
2
+ 2016-11-02 02:00:02.000000 +0000,first
3
+ 2016-11-02 03:00:03.000000 +0000,first
4
+ 2016-11-02 04:00:04.000000 +0000,first
5
+ 2016-11-02 04:00:05.111001 +0000,first
6
+ 2016-11-02 04:00:05.222002 +0000,first
7
+ 2016-11-02 04:00:05.333003 +0000,first