embulk-output-cdata 0.3.2 → 0.3.3

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: 8a3cdb615898f0b5f980e597a3aac123887e1a0a
4
- data.tar.gz: 32306e949ade767badffbfc3219e3832ef174349
3
+ metadata.gz: 68d9df61354ee1371c25b674abc9645f628a09cc
4
+ data.tar.gz: bd325f4e7ba5d0614ee5ba275131273894a708ed
5
5
  SHA512:
6
- metadata.gz: 993ca708cdde78f34c5de788610661ea2bee8a3ac1f1096c73c16dea342f6ff25e7aae96581e995db4164c6cb7db3c5c602babf1f9306faa90060b05b70857a6
7
- data.tar.gz: 74abba526f8ae3800bc66680af429ad0e0900c93a02d2ab4f56b8a1ba5f30b5a4cd086051050c01c0570b1a2902b0a51cb02011a8b6ddebac4866fe7534a2f4e
6
+ metadata.gz: 2a59f5082958068b786731a2c54edd53cf0b71c4b700e4a1c5d9bc93b60223c40e70dd615d048c1bfc276662de9c103169585e9e28781f8197da66c28c6f07b5
7
+ data.tar.gz: 7a46a6475de051f5ff6a63303eb9d870f3667c6bf9f5a6550e6568a8d5bf722b5f1a6cfdd38a4eb656c02139fd89831d45bd00f06596be8c8db7488189937bf3
data/build.gradle CHANGED
@@ -13,7 +13,7 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.3.2"
16
+ version = "0.3.3"
17
17
 
18
18
  sourceCompatibility = 1.8
19
19
  targetCompatibility = 1.8
@@ -85,7 +85,7 @@ Gem::Specification.new do |spec|
85
85
  spec.description = %[Dumps records to Cdata.]
86
86
  spec.email = ["m.nishitsuji@gmail.com"]
87
87
  spec.licenses = ["MIT"]
88
- # TODO set this: spec.homepage = "https://github.com/m.nishitsuji/embulk-output-cdata"
88
+ spec.homepage = "https://github.com/datable-inc/embulk-output-cdata"
89
89
 
90
90
  spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
91
91
  spec.test_files = spec.files.grep(%r"^(test|spec)/")
@@ -81,7 +81,11 @@ public class CDataPageOutputForUpdate implements TransactionalPageOutput {
81
81
  @Override
82
82
  public void booleanColumn(Column column) {
83
83
  try {
84
- preparedStatement.setBoolean(column.getIndex() + 2, pageReader.getBoolean(column));
84
+ if (pageReader.getString(column) == null) {
85
+ preparedStatement.setObject(column.getIndex() + 2, null);
86
+ } else {
87
+ preparedStatement.setBoolean(column.getIndex() + 2, pageReader.getBoolean(column));
88
+ }
85
89
  } catch (SQLException e) {
86
90
  throw new RuntimeException(e);
87
91
  }
@@ -90,7 +94,11 @@ public class CDataPageOutputForUpdate implements TransactionalPageOutput {
90
94
  @Override
91
95
  public void longColumn(Column column) {
92
96
  try {
93
- preparedStatement.setLong(column.getIndex() + 2, pageReader.getLong(column));
97
+ if (pageReader.getString(column) == null) {
98
+ preparedStatement.setObject(column.getIndex() + 2, null);
99
+ } else {
100
+ preparedStatement.setLong(column.getIndex() + 2, pageReader.getLong(column));
101
+ }
94
102
  } catch (SQLException e) {
95
103
  throw new RuntimeException(e);
96
104
  }
@@ -99,7 +107,11 @@ public class CDataPageOutputForUpdate implements TransactionalPageOutput {
99
107
  @Override
100
108
  public void doubleColumn(Column column) {
101
109
  try {
102
- preparedStatement.setDouble(column.getIndex() + 2, pageReader.getDouble(column));
110
+ if (pageReader.getString(column) == null) {
111
+ preparedStatement.setObject(column.getIndex() + 2, null);
112
+ } else {
113
+ preparedStatement.setDouble(column.getIndex() + 2, pageReader.getDouble(column));
114
+ }
103
115
  } catch (SQLException e) {
104
116
  throw new RuntimeException(e);
105
117
  }
@@ -111,7 +123,11 @@ public class CDataPageOutputForUpdate implements TransactionalPageOutput {
111
123
  if (Objects.equals(column.getName(), task.getExternalIdColumn())) {
112
124
  currentExternalIdColumn = pageReader.getString(column);
113
125
  }
114
- preparedStatement.setString(column.getIndex() + 2, pageReader.getString(column));
126
+ if (pageReader.getString(column) == null) {
127
+ preparedStatement.setObject(column.getIndex() + 2, null);
128
+ } else {
129
+ preparedStatement.setString(column.getIndex() + 2, pageReader.getString(column));
130
+ }
115
131
  } catch (SQLException e) {
116
132
  throw new RuntimeException(e);
117
133
  }
@@ -120,7 +136,11 @@ public class CDataPageOutputForUpdate implements TransactionalPageOutput {
120
136
  @Override
121
137
  public void timestampColumn(Column column) {
122
138
  try {
123
- preparedStatement.setTimestamp(column.getIndex() + 2, Timestamp.from(pageReader.getTimestampInstant(column)));
139
+ if (pageReader.getString(column) == null) {
140
+ preparedStatement.setObject(column.getIndex() + 2, null);
141
+ } else {
142
+ preparedStatement.setTimestamp(column.getIndex() + 2, Timestamp.from(pageReader.getTimestampInstant(column)));
143
+ }
124
144
  } catch (SQLException e) {
125
145
  throw new RuntimeException(e);
126
146
  }
@@ -129,7 +149,11 @@ public class CDataPageOutputForUpdate implements TransactionalPageOutput {
129
149
  @Override
130
150
  public void jsonColumn(Column column) {
131
151
  try {
132
- preparedStatement.setString(column.getIndex() + 2, pageReader.getString(column));
152
+ if (pageReader.getString(column) == null) {
153
+ preparedStatement.setObject(column.getIndex() + 2, null);
154
+ } else {
155
+ preparedStatement.setString(column.getIndex() + 2, pageReader.getString(column));
156
+ }
133
157
  } catch (SQLException e) {
134
158
  throw new RuntimeException(e);
135
159
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-cdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sampo02
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-22 00:00:00.000000000 Z
11
+ date: 2022-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ files:
49
49
  - LICENSE.txt
50
50
  - README.md
51
51
  - build.gradle
52
- - classpath/embulk-output-cdata-0.3.2.jar
52
+ - classpath/embulk-output-cdata-0.3.3.jar
53
53
  - config/checkstyle/checkstyle.xml
54
54
  - config/checkstyle/default.xml
55
55
  - gradle/wrapper/gradle-wrapper.jar
@@ -61,7 +61,7 @@ files:
61
61
  - src/main/java/org/embulk/output/cdata/CDataPageOutputForUpdate.java
62
62
  - src/main/java/org/embulk/output/cdata/CDataPageOutputForUpsert.java
63
63
  - src/test/java/org/embulk/output/cdata/TestCDataOutputPlugin.java
64
- homepage:
64
+ homepage: https://github.com/datable-inc/embulk-output-cdata
65
65
  licenses:
66
66
  - MIT
67
67
  metadata: {}