embulk-output-oracle 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +155 -110
- data/build.gradle +6 -6
- data/classpath/embulk-output-jdbc-0.3.0.jar +0 -0
- data/classpath/embulk-output-oracle-0.3.0.jar +0 -0
- data/lib/embulk/output/oracle.rb +3 -3
- data/src/main/cpp/common/dir-path-load.cpp +424 -424
- data/src/main/cpp/common/dir-path-load.h +36 -36
- data/src/main/cpp/common/embulk-output-oracle.cpp +196 -196
- data/src/main/cpp/common/org_embulk_output_oracle_oci_OCI.h +77 -77
- data/src/main/cpp/linux/build.sh +21 -21
- data/src/main/cpp/win/build.bat +31 -31
- data/src/main/cpp/win/dllmain.cpp +25 -25
- data/src/main/cpp/win/embulk-output-oracle.sln +39 -39
- data/src/main/cpp/win/embulk-output-oracle.vcxproj +175 -175
- data/src/main/java/org/embulk/output/OracleOutputPlugin.java +22 -66
- data/src/main/java/org/embulk/output/oracle/DirectBatchInsert.java +289 -289
- data/src/main/java/org/embulk/output/oracle/InsertMethod.java +8 -8
- data/src/main/java/org/embulk/output/oracle/OracleCharset.java +32 -19
- data/src/main/java/org/embulk/output/oracle/OracleOutputConnection.java +165 -134
- data/src/main/java/org/embulk/output/oracle/OracleOutputConnector.java +49 -49
- data/src/main/java/org/embulk/output/oracle/TimestampFormat.java +37 -37
- data/src/main/java/org/embulk/output/oracle/oci/ColumnDefinition.java +26 -26
- data/src/main/java/org/embulk/output/oracle/oci/OCI.java +139 -139
- data/src/main/java/org/embulk/output/oracle/oci/OCIManager.java +64 -64
- data/src/main/java/org/embulk/output/oracle/oci/OCIWrapper.java +96 -96
- data/src/main/java/org/embulk/output/oracle/oci/RowBuffer.java +99 -99
- data/src/main/java/org/embulk/output/oracle/oci/TableDefinition.java +24 -24
- data/src/test/cpp/common/embulk-output-oracle-test.cpp +69 -69
- data/src/test/cpp/linux/build.sh +19 -19
- data/src/test/cpp/win/build.bat +28 -28
- data/src/test/cpp/win/embulk-output-oracle-test.vcxproj +154 -154
- data/src/test/java/org/embulk/input/filesplit/LocalFileSplitInputPlugin.java +187 -187
- data/src/test/java/org/embulk/input/filesplit/PartialFile.java +49 -49
- data/src/test/java/org/embulk/input/filesplit/PartialFileInputStream.java +154 -154
- data/src/test/java/org/embulk/output/oracle/ChildFirstClassLoader.java +42 -42
- data/src/test/java/org/embulk/output/oracle/EmbulkPluginTester.java +120 -120
- data/src/test/java/org/embulk/output/oracle/EmptyConfigSource.java +100 -100
- data/src/test/java/org/embulk/output/oracle/OracleOutputPluginTest.java +172 -161
- data/src/test/java/org/embulk/output/oracle/OracleOutputPluginTestImpl.java +445 -413
- data/src/test/java/org/embulk/output/oracle/TimestampFormatTest.java +57 -57
- data/src/test/resources/data/test1/test1.csv +3 -3
- data/src/test/resources/yml/test-insert-direct.yml +26 -26
- data/src/test/resources/yml/test-insert-oci-split.yml +26 -26
- data/src/test/resources/yml/test-insert-oci.yml +26 -26
- data/src/test/resources/yml/test-insert.yml +25 -25
- data/src/test/resources/yml/test-replace-long-name-multibyte.yml +25 -0
- data/src/test/resources/yml/test-replace-long-name.yml +25 -25
- data/src/test/resources/yml/test-replace.yml +25 -25
- data/src/test/resources/yml/test-string-timestamp.yml +25 -0
- data/src/test/resources/yml/test-url.yml +24 -24
- metadata +6 -5
- data/classpath/embulk-output-jdbc-0.2.4.jar +0 -0
- data/classpath/embulk-output-oracle-0.2.4.jar +0 -0
- data/src/main/java/org/embulk/output/oracle/setter/OracleColumnSetterFactory.java +0 -31
@@ -1,57 +1,57 @@
|
|
1
|
-
package org.embulk.output.oracle;
|
2
|
-
|
3
|
-
import java.sql.Timestamp;
|
4
|
-
import java.text.ParseException;
|
5
|
-
import java.text.SimpleDateFormat;
|
6
|
-
import java.util.Date;
|
7
|
-
|
8
|
-
import org.junit.Test;
|
9
|
-
import static org.junit.Assert.assertEquals;
|
10
|
-
|
11
|
-
public class TimestampFormatTest {
|
12
|
-
|
13
|
-
@Test
|
14
|
-
public void test() throws ParseException
|
15
|
-
{
|
16
|
-
Date date = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").parse("2015/03/04 17:08:09");
|
17
|
-
Timestamp t = new Timestamp(date.getTime());
|
18
|
-
|
19
|
-
{
|
20
|
-
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 9);
|
21
|
-
assertEquals("2015-03-04 17:08:09.000000000", format.format(t));
|
22
|
-
}
|
23
|
-
{
|
24
|
-
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 0);
|
25
|
-
assertEquals("2015-03-04 17:08:09", format.format(t));
|
26
|
-
}
|
27
|
-
{
|
28
|
-
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 1);
|
29
|
-
assertEquals("2015-03-04 17:08:09.0", format.format(t));
|
30
|
-
}
|
31
|
-
|
32
|
-
t.setNanos(1234567);
|
33
|
-
{
|
34
|
-
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 9);
|
35
|
-
assertEquals("2015-03-04 17:08:09.001234567", format.format(t));
|
36
|
-
}
|
37
|
-
{
|
38
|
-
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 2);
|
39
|
-
assertEquals("2015-03-04 17:08:09.00", format.format(t));
|
40
|
-
}
|
41
|
-
{
|
42
|
-
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 3);
|
43
|
-
assertEquals("2015-03-04 17:08:09.001", format.format(t));
|
44
|
-
}
|
45
|
-
|
46
|
-
t.setNanos(123456789);
|
47
|
-
{
|
48
|
-
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 9);
|
49
|
-
assertEquals("2015-03-04 17:08:09.123456789", format.format(t));
|
50
|
-
}
|
51
|
-
{
|
52
|
-
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 1);
|
53
|
-
assertEquals("2015-03-04 17:08:09.1", format.format(t));
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
}
|
1
|
+
package org.embulk.output.oracle;
|
2
|
+
|
3
|
+
import java.sql.Timestamp;
|
4
|
+
import java.text.ParseException;
|
5
|
+
import java.text.SimpleDateFormat;
|
6
|
+
import java.util.Date;
|
7
|
+
|
8
|
+
import org.junit.Test;
|
9
|
+
import static org.junit.Assert.assertEquals;
|
10
|
+
|
11
|
+
public class TimestampFormatTest {
|
12
|
+
|
13
|
+
@Test
|
14
|
+
public void test() throws ParseException
|
15
|
+
{
|
16
|
+
Date date = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").parse("2015/03/04 17:08:09");
|
17
|
+
Timestamp t = new Timestamp(date.getTime());
|
18
|
+
|
19
|
+
{
|
20
|
+
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 9);
|
21
|
+
assertEquals("2015-03-04 17:08:09.000000000", format.format(t));
|
22
|
+
}
|
23
|
+
{
|
24
|
+
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 0);
|
25
|
+
assertEquals("2015-03-04 17:08:09", format.format(t));
|
26
|
+
}
|
27
|
+
{
|
28
|
+
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 1);
|
29
|
+
assertEquals("2015-03-04 17:08:09.0", format.format(t));
|
30
|
+
}
|
31
|
+
|
32
|
+
t.setNanos(1234567);
|
33
|
+
{
|
34
|
+
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 9);
|
35
|
+
assertEquals("2015-03-04 17:08:09.001234567", format.format(t));
|
36
|
+
}
|
37
|
+
{
|
38
|
+
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 2);
|
39
|
+
assertEquals("2015-03-04 17:08:09.00", format.format(t));
|
40
|
+
}
|
41
|
+
{
|
42
|
+
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 3);
|
43
|
+
assertEquals("2015-03-04 17:08:09.001", format.format(t));
|
44
|
+
}
|
45
|
+
|
46
|
+
t.setNanos(123456789);
|
47
|
+
{
|
48
|
+
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 9);
|
49
|
+
assertEquals("2015-03-04 17:08:09.123456789", format.format(t));
|
50
|
+
}
|
51
|
+
{
|
52
|
+
TimestampFormat format = new TimestampFormat("yyyy-MM-dd HH:mm:ss", 1);
|
53
|
+
assertEquals("2015-03-04 17:08:09.1", format.format(t));
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
A001,ABCDE,0,123.45,2015/03/05,2015/03/05 12:34:56
|
2
|
-
A002,あいうえお,-9999,-99999999.99,2015/03/06,2015/03/06 23:59:59
|
3
|
-
A003,,,,,
|
1
|
+
A001,ABCDE,0,123.45,2015/03/05,2015/03/05 12:34:56
|
2
|
+
A002,あいうえお,-9999,-99999999.99,2015/03/06,2015/03/06 23:59:59
|
3
|
+
A003,,,,,
|
@@ -1,26 +1,26 @@
|
|
1
|
-
in:
|
2
|
-
type: file
|
3
|
-
path_prefix: '/data/test1/test1.csv'
|
4
|
-
parser:
|
5
|
-
charset: UTF-8
|
6
|
-
newline: CRLF
|
7
|
-
type: csv
|
8
|
-
delimiter: ','
|
9
|
-
quote: ''
|
10
|
-
columns:
|
11
|
-
- {name: ID, type: string}
|
12
|
-
- {name: VARCHAR2_ITEM, type: string}
|
13
|
-
- {name: INTEGER_ITEM, type: long}
|
14
|
-
- {name: NUMBER_ITEM, type: string}
|
15
|
-
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
-
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
-
out:
|
18
|
-
type: oracle
|
19
|
-
host: localhost
|
20
|
-
database: TESTDB
|
21
|
-
user: TEST_USER
|
22
|
-
password: test_pw
|
23
|
-
table: TEST1
|
24
|
-
mode: insert
|
25
|
-
insert_method: direct
|
26
|
-
#driver_path: driver/ojdbc7.jar
|
1
|
+
in:
|
2
|
+
type: file
|
3
|
+
path_prefix: '/data/test1/test1.csv'
|
4
|
+
parser:
|
5
|
+
charset: UTF-8
|
6
|
+
newline: CRLF
|
7
|
+
type: csv
|
8
|
+
delimiter: ','
|
9
|
+
quote: ''
|
10
|
+
columns:
|
11
|
+
- {name: ID, type: string}
|
12
|
+
- {name: VARCHAR2_ITEM, type: string}
|
13
|
+
- {name: INTEGER_ITEM, type: long}
|
14
|
+
- {name: NUMBER_ITEM, type: string}
|
15
|
+
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
+
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
+
out:
|
18
|
+
type: oracle
|
19
|
+
host: localhost
|
20
|
+
database: TESTDB
|
21
|
+
user: TEST_USER
|
22
|
+
password: test_pw
|
23
|
+
table: TEST1
|
24
|
+
mode: insert
|
25
|
+
insert_method: direct
|
26
|
+
#driver_path: driver/ojdbc7.jar
|
@@ -1,26 +1,26 @@
|
|
1
|
-
in:
|
2
|
-
type: filesplit
|
3
|
-
path: '/data/test1/test1.csv'
|
4
|
-
parser:
|
5
|
-
charset: UTF-8
|
6
|
-
newline: CRLF
|
7
|
-
type: csv
|
8
|
-
delimiter: ','
|
9
|
-
quote: ''
|
10
|
-
columns:
|
11
|
-
- {name: ID, type: string}
|
12
|
-
- {name: VARCHAR2_ITEM, type: string}
|
13
|
-
- {name: INTEGER_ITEM, type: long}
|
14
|
-
- {name: NUMBER_ITEM, type: string}
|
15
|
-
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
-
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
-
out:
|
18
|
-
type: oracle
|
19
|
-
host: localhost
|
20
|
-
database: TESTDB
|
21
|
-
user: TEST_USER
|
22
|
-
password: test_pw
|
23
|
-
table: TEST1
|
24
|
-
mode: insert
|
25
|
-
insert_method: oci
|
26
|
-
#driver_path: driver/ojdbc7.jar
|
1
|
+
in:
|
2
|
+
type: filesplit
|
3
|
+
path: '/data/test1/test1.csv'
|
4
|
+
parser:
|
5
|
+
charset: UTF-8
|
6
|
+
newline: CRLF
|
7
|
+
type: csv
|
8
|
+
delimiter: ','
|
9
|
+
quote: ''
|
10
|
+
columns:
|
11
|
+
- {name: ID, type: string}
|
12
|
+
- {name: VARCHAR2_ITEM, type: string}
|
13
|
+
- {name: INTEGER_ITEM, type: long}
|
14
|
+
- {name: NUMBER_ITEM, type: string}
|
15
|
+
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
+
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
+
out:
|
18
|
+
type: oracle
|
19
|
+
host: localhost
|
20
|
+
database: TESTDB
|
21
|
+
user: TEST_USER
|
22
|
+
password: test_pw
|
23
|
+
table: TEST1
|
24
|
+
mode: insert
|
25
|
+
insert_method: oci
|
26
|
+
#driver_path: driver/ojdbc7.jar
|
@@ -1,26 +1,26 @@
|
|
1
|
-
in:
|
2
|
-
type: file
|
3
|
-
path_prefix: '/data/test1/test1.csv'
|
4
|
-
parser:
|
5
|
-
charset: UTF-8
|
6
|
-
newline: CRLF
|
7
|
-
type: csv
|
8
|
-
delimiter: ','
|
9
|
-
quote: ''
|
10
|
-
columns:
|
11
|
-
- {name: ID, type: string}
|
12
|
-
- {name: VARCHAR2_ITEM, type: string}
|
13
|
-
- {name: INTEGER_ITEM, type: long}
|
14
|
-
- {name: NUMBER_ITEM, type: string}
|
15
|
-
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
-
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
-
out:
|
18
|
-
type: oracle
|
19
|
-
host: localhost
|
20
|
-
database: TESTDB
|
21
|
-
user: TEST_USER
|
22
|
-
password: test_pw
|
23
|
-
table: TEST1
|
24
|
-
mode: insert
|
25
|
-
insert_method: oci
|
26
|
-
#driver_path: driver/ojdbc7.jar
|
1
|
+
in:
|
2
|
+
type: file
|
3
|
+
path_prefix: '/data/test1/test1.csv'
|
4
|
+
parser:
|
5
|
+
charset: UTF-8
|
6
|
+
newline: CRLF
|
7
|
+
type: csv
|
8
|
+
delimiter: ','
|
9
|
+
quote: ''
|
10
|
+
columns:
|
11
|
+
- {name: ID, type: string}
|
12
|
+
- {name: VARCHAR2_ITEM, type: string}
|
13
|
+
- {name: INTEGER_ITEM, type: long}
|
14
|
+
- {name: NUMBER_ITEM, type: string}
|
15
|
+
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
+
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
+
out:
|
18
|
+
type: oracle
|
19
|
+
host: localhost
|
20
|
+
database: TESTDB
|
21
|
+
user: TEST_USER
|
22
|
+
password: test_pw
|
23
|
+
table: TEST1
|
24
|
+
mode: insert
|
25
|
+
insert_method: oci
|
26
|
+
#driver_path: driver/ojdbc7.jar
|
@@ -1,25 +1,25 @@
|
|
1
|
-
in:
|
2
|
-
type: file
|
3
|
-
path_prefix: '/data/test1/test1.csv'
|
4
|
-
parser:
|
5
|
-
charset: UTF-8
|
6
|
-
newline: CRLF
|
7
|
-
type: csv
|
8
|
-
delimiter: ','
|
9
|
-
quote: ''
|
10
|
-
columns:
|
11
|
-
- {name: ID, type: string}
|
12
|
-
- {name: VARCHAR2_ITEM, type: string}
|
13
|
-
- {name: INTEGER_ITEM, type: long}
|
14
|
-
- {name: NUMBER_ITEM, type: string}
|
15
|
-
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
-
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
-
out:
|
18
|
-
type: oracle
|
19
|
-
host: localhost
|
20
|
-
database: TESTDB
|
21
|
-
user: TEST_USER
|
22
|
-
password: test_pw
|
23
|
-
table: TEST1
|
24
|
-
mode: insert
|
25
|
-
#driver_path: driver/ojdbc7.jar
|
1
|
+
in:
|
2
|
+
type: file
|
3
|
+
path_prefix: '/data/test1/test1.csv'
|
4
|
+
parser:
|
5
|
+
charset: UTF-8
|
6
|
+
newline: CRLF
|
7
|
+
type: csv
|
8
|
+
delimiter: ','
|
9
|
+
quote: ''
|
10
|
+
columns:
|
11
|
+
- {name: ID, type: string}
|
12
|
+
- {name: VARCHAR2_ITEM, type: string}
|
13
|
+
- {name: INTEGER_ITEM, type: long}
|
14
|
+
- {name: NUMBER_ITEM, type: string}
|
15
|
+
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
+
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
+
out:
|
18
|
+
type: oracle
|
19
|
+
host: localhost
|
20
|
+
database: TESTDB
|
21
|
+
user: TEST_USER
|
22
|
+
password: test_pw
|
23
|
+
table: TEST1
|
24
|
+
mode: insert
|
25
|
+
#driver_path: driver/ojdbc7.jar
|
@@ -0,0 +1,25 @@
|
|
1
|
+
in:
|
2
|
+
type: file
|
3
|
+
path_prefix: '/data/test1/test1.csv'
|
4
|
+
parser:
|
5
|
+
charset: UTF-8
|
6
|
+
newline: CRLF
|
7
|
+
type: csv
|
8
|
+
delimiter: ','
|
9
|
+
quote: ''
|
10
|
+
columns:
|
11
|
+
- {name: ID, type: string}
|
12
|
+
- {name: VARCHAR2_ITEM, type: string}
|
13
|
+
- {name: INTEGER_ITEM, type: long}
|
14
|
+
- {name: NUMBER_ITEM, type: string}
|
15
|
+
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
+
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
+
out:
|
18
|
+
type: oracle
|
19
|
+
host: localhost
|
20
|
+
database: TESTDB
|
21
|
+
user: TEST_USER
|
22
|
+
password: test_pw
|
23
|
+
table: TEST12345678901234567890
|
24
|
+
mode: replace
|
25
|
+
#driver_path: driver/ojdbc7.jar
|
@@ -1,25 +1,25 @@
|
|
1
|
-
in:
|
2
|
-
type: file
|
3
|
-
path_prefix: '/data/test1/test1.csv'
|
4
|
-
parser:
|
5
|
-
charset: UTF-8
|
6
|
-
newline: CRLF
|
7
|
-
type: csv
|
8
|
-
delimiter: ','
|
9
|
-
quote: ''
|
10
|
-
columns:
|
11
|
-
- {name: ID, type: string}
|
12
|
-
- {name: VARCHAR2_ITEM, type: string}
|
13
|
-
- {name: INTEGER_ITEM, type: long}
|
14
|
-
- {name: NUMBER_ITEM, type: string}
|
15
|
-
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
-
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
-
out:
|
18
|
-
type: oracle
|
19
|
-
host: localhost
|
20
|
-
database: TESTDB
|
21
|
-
user: TEST_USER
|
22
|
-
password: test_pw
|
23
|
-
table: TEST12345678901234567890123456
|
24
|
-
mode: replace
|
25
|
-
#driver_path: driver/ojdbc7.jar
|
1
|
+
in:
|
2
|
+
type: file
|
3
|
+
path_prefix: '/data/test1/test1.csv'
|
4
|
+
parser:
|
5
|
+
charset: UTF-8
|
6
|
+
newline: CRLF
|
7
|
+
type: csv
|
8
|
+
delimiter: ','
|
9
|
+
quote: ''
|
10
|
+
columns:
|
11
|
+
- {name: ID, type: string}
|
12
|
+
- {name: VARCHAR2_ITEM, type: string}
|
13
|
+
- {name: INTEGER_ITEM, type: long}
|
14
|
+
- {name: NUMBER_ITEM, type: string}
|
15
|
+
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
+
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
+
out:
|
18
|
+
type: oracle
|
19
|
+
host: localhost
|
20
|
+
database: TESTDB
|
21
|
+
user: TEST_USER
|
22
|
+
password: test_pw
|
23
|
+
table: TEST12345678901234567890123456
|
24
|
+
mode: replace
|
25
|
+
#driver_path: driver/ojdbc7.jar
|
@@ -1,25 +1,25 @@
|
|
1
|
-
in:
|
2
|
-
type: file
|
3
|
-
path_prefix: '/data/test1/test1.csv'
|
4
|
-
parser:
|
5
|
-
charset: UTF-8
|
6
|
-
newline: CRLF
|
7
|
-
type: csv
|
8
|
-
delimiter: ','
|
9
|
-
quote: ''
|
10
|
-
columns:
|
11
|
-
- {name: ID, type: string}
|
12
|
-
- {name: VARCHAR2_ITEM, type: string}
|
13
|
-
- {name: INTEGER_ITEM, type: long}
|
14
|
-
- {name: NUMBER_ITEM, type: string}
|
15
|
-
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
-
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
-
out:
|
18
|
-
type: oracle
|
19
|
-
host: localhost
|
20
|
-
database: TESTDB
|
21
|
-
user: TEST_USER
|
22
|
-
password: test_pw
|
23
|
-
table: TEST1
|
24
|
-
mode: replace
|
25
|
-
#driver_path: driver/ojdbc7.jar
|
1
|
+
in:
|
2
|
+
type: file
|
3
|
+
path_prefix: '/data/test1/test1.csv'
|
4
|
+
parser:
|
5
|
+
charset: UTF-8
|
6
|
+
newline: CRLF
|
7
|
+
type: csv
|
8
|
+
delimiter: ','
|
9
|
+
quote: ''
|
10
|
+
columns:
|
11
|
+
- {name: ID, type: string}
|
12
|
+
- {name: VARCHAR2_ITEM, type: string}
|
13
|
+
- {name: INTEGER_ITEM, type: long}
|
14
|
+
- {name: NUMBER_ITEM, type: string}
|
15
|
+
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
+
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
+
out:
|
18
|
+
type: oracle
|
19
|
+
host: localhost
|
20
|
+
database: TESTDB
|
21
|
+
user: TEST_USER
|
22
|
+
password: test_pw
|
23
|
+
table: TEST1
|
24
|
+
mode: replace
|
25
|
+
#driver_path: driver/ojdbc7.jar
|
@@ -0,0 +1,25 @@
|
|
1
|
+
in:
|
2
|
+
type: file
|
3
|
+
path_prefix: '/data/test1/test1.csv'
|
4
|
+
parser:
|
5
|
+
charset: UTF-8
|
6
|
+
newline: CRLF
|
7
|
+
type: csv
|
8
|
+
delimiter: ','
|
9
|
+
quote: ''
|
10
|
+
columns:
|
11
|
+
- {name: ID, type: string}
|
12
|
+
- {name: VARCHAR2_ITEM, type: string}
|
13
|
+
- {name: INTEGER_ITEM, type: long}
|
14
|
+
- {name: NUMBER_ITEM, type: string}
|
15
|
+
- {name: DATE_ITEM, type: string}
|
16
|
+
- {name: TIMESTAMP_ITEM, type: string}
|
17
|
+
out:
|
18
|
+
type: oracle
|
19
|
+
host: localhost
|
20
|
+
database: TESTDB
|
21
|
+
user: TEST_USER
|
22
|
+
password: test_pw
|
23
|
+
table: TEST1
|
24
|
+
mode: insert
|
25
|
+
#driver_path: driver/ojdbc7.jar
|
@@ -1,24 +1,24 @@
|
|
1
|
-
in:
|
2
|
-
type: file
|
3
|
-
path_prefix: '/data/test1/test1.csv'
|
4
|
-
parser:
|
5
|
-
charset: UTF-8
|
6
|
-
newline: CRLF
|
7
|
-
type: csv
|
8
|
-
delimiter: ','
|
9
|
-
quote: ''
|
10
|
-
columns:
|
11
|
-
- {name: ID, type: string}
|
12
|
-
- {name: VARCHAR2_ITEM, type: string}
|
13
|
-
- {name: INTEGER_ITEM, type: long}
|
14
|
-
- {name: NUMBER_ITEM, type: string}
|
15
|
-
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
-
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
-
out:
|
18
|
-
type: oracle
|
19
|
-
user: TEST_USER
|
20
|
-
password: test_pw
|
21
|
-
table: TEST1
|
22
|
-
mode: insert
|
23
|
-
#driver_path: driver/ojdbc7.jar
|
24
|
-
url: jdbc:oracle:thin:@localhost:1521:TESTDB
|
1
|
+
in:
|
2
|
+
type: file
|
3
|
+
path_prefix: '/data/test1/test1.csv'
|
4
|
+
parser:
|
5
|
+
charset: UTF-8
|
6
|
+
newline: CRLF
|
7
|
+
type: csv
|
8
|
+
delimiter: ','
|
9
|
+
quote: ''
|
10
|
+
columns:
|
11
|
+
- {name: ID, type: string}
|
12
|
+
- {name: VARCHAR2_ITEM, type: string}
|
13
|
+
- {name: INTEGER_ITEM, type: long}
|
14
|
+
- {name: NUMBER_ITEM, type: string}
|
15
|
+
- {name: DATE_ITEM, type: timestamp, format: '%Y/%m/%d'}
|
16
|
+
- {name: TIMESTAMP_ITEM, type: timestamp, format: '%Y/%m/%d %H:%M:%S'}
|
17
|
+
out:
|
18
|
+
type: oracle
|
19
|
+
user: TEST_USER
|
20
|
+
password: test_pw
|
21
|
+
table: TEST1
|
22
|
+
mode: insert
|
23
|
+
#driver_path: driver/ojdbc7.jar
|
24
|
+
url: jdbc:oracle:thin:@localhost:1521:TESTDB
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-oracle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.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-05-
|
11
|
+
date: 2015-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Inserts or updates records to a table.
|
14
14
|
email:
|
@@ -44,7 +44,6 @@ files:
|
|
44
44
|
- src/main/java/org/embulk/output/oracle/oci/OCIWrapper.java
|
45
45
|
- src/main/java/org/embulk/output/oracle/oci/RowBuffer.java
|
46
46
|
- src/main/java/org/embulk/output/oracle/oci/TableDefinition.java
|
47
|
-
- src/main/java/org/embulk/output/oracle/setter/OracleColumnSetterFactory.java
|
48
47
|
- src/test/cpp/common/embulk-output-oracle-test.cpp
|
49
48
|
- src/test/cpp/linux/build.sh
|
50
49
|
- src/test/cpp/win/build.bat
|
@@ -63,11 +62,13 @@ files:
|
|
63
62
|
- src/test/resources/yml/test-insert-oci-split.yml
|
64
63
|
- src/test/resources/yml/test-insert-oci.yml
|
65
64
|
- src/test/resources/yml/test-insert.yml
|
65
|
+
- src/test/resources/yml/test-replace-long-name-multibyte.yml
|
66
66
|
- src/test/resources/yml/test-replace-long-name.yml
|
67
67
|
- src/test/resources/yml/test-replace.yml
|
68
|
+
- src/test/resources/yml/test-string-timestamp.yml
|
68
69
|
- src/test/resources/yml/test-url.yml
|
69
|
-
- classpath/embulk-output-jdbc-0.
|
70
|
-
- classpath/embulk-output-oracle-0.
|
70
|
+
- classpath/embulk-output-jdbc-0.3.0.jar
|
71
|
+
- classpath/embulk-output-oracle-0.3.0.jar
|
71
72
|
homepage: https://github.com/embulk/embulk-output-jdbc
|
72
73
|
licenses:
|
73
74
|
- Apache 2.0
|
Binary file
|
Binary file
|
@@ -1,31 +0,0 @@
|
|
1
|
-
package org.embulk.output.oracle.setter;
|
2
|
-
|
3
|
-
import java.sql.Types;
|
4
|
-
|
5
|
-
import org.embulk.output.jdbc.BatchInsert;
|
6
|
-
import org.embulk.output.jdbc.JdbcColumn;
|
7
|
-
import org.embulk.output.jdbc.setter.ColumnSetter;
|
8
|
-
import org.embulk.output.jdbc.setter.ColumnSetterFactory;
|
9
|
-
import org.embulk.output.jdbc.setter.StringColumnSetter;
|
10
|
-
import org.embulk.spi.PageReader;
|
11
|
-
import org.embulk.spi.time.TimestampFormatter;
|
12
|
-
|
13
|
-
public class OracleColumnSetterFactory extends ColumnSetterFactory
|
14
|
-
{
|
15
|
-
public OracleColumnSetterFactory(BatchInsert batch, PageReader pageReader,
|
16
|
-
TimestampFormatter timestampFormatter)
|
17
|
-
{
|
18
|
-
super(batch, pageReader, timestampFormatter);
|
19
|
-
}
|
20
|
-
|
21
|
-
@Override
|
22
|
-
public ColumnSetter newColumnSetter(JdbcColumn column)
|
23
|
-
{
|
24
|
-
switch (column.getSqlType()) {
|
25
|
-
case Types.DECIMAL:
|
26
|
-
return new StringColumnSetter(batch, pageReader, column, timestampFormatter);
|
27
|
-
default:
|
28
|
-
return super.newColumnSetter(column);
|
29
|
-
}
|
30
|
-
}
|
31
|
-
}
|