embulk-output-cdata 0.3.1 → 0.3.4

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: 90fadee674529b7de2ad81d3ae7d4d541897f250
4
- data.tar.gz: c4e6016c12c8d13e85050d737dfbe5fe85c26d67
3
+ metadata.gz: 6f2031c04f4a622373cbb14b248c8c38650d0483
4
+ data.tar.gz: 9fee98da33876dc3e8a22f89dfe23ba802cdc717
5
5
  SHA512:
6
- metadata.gz: 18e8c5c020dfb018aa6648df569dbae1e598e32b702baa58bd60a9ffdaf0f46bbbf9efc010d7fa20604090d9505fd78f1a740b14bd67f7fde45710ec649d4618
7
- data.tar.gz: f090bf63e1c8a13f1abf4b3c172646e6d6da679ebf1d68fdcbea06f955a6cdd9d642e68c749eee71c8f6f369ce359131091159a165d498a21fbcb66665755682
6
+ metadata.gz: 7c4eabc9a60cc5760195a6a32cbf8c59bd4c5cecf1fcfa4daea36264d2f3e6c03e1bcba405fc68cca7bf562b7fb5e3ef9c5cc2cc4197732a8ff81ce278c10e47
7
+ data.tar.gz: 2b2731fbc43c274b61a683ce13c3141633c435683b91c717c5823e37c08cc28fca70aeb0bb11ef2f93af9fffd5d22527db27281214bbf4d09c152f0fbe6a8398
data/build.gradle CHANGED
@@ -13,7 +13,7 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.3.1"
16
+ version = "0.3.4"
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,8 +81,11 @@ public class CDataPageOutputForUpdate implements TransactionalPageOutput {
81
81
  @Override
82
82
  public void booleanColumn(Column column) {
83
83
  try {
84
- logger.info(column.getName() + ": " + pageReader.getBoolean(column));
85
- preparedStatement.setBoolean(column.getIndex() + 2, pageReader.getBoolean(column));
84
+ if (pageReader.isNull(column)) {
85
+ preparedStatement.setObject(column.getIndex() + 2, null);
86
+ } else {
87
+ preparedStatement.setBoolean(column.getIndex() + 2, pageReader.getBoolean(column));
88
+ }
86
89
  } catch (SQLException e) {
87
90
  throw new RuntimeException(e);
88
91
  }
@@ -91,8 +94,11 @@ public class CDataPageOutputForUpdate implements TransactionalPageOutput {
91
94
  @Override
92
95
  public void longColumn(Column column) {
93
96
  try {
94
- logger.info(column.getName() + ": " + pageReader.getLong(column));
95
- preparedStatement.setLong(column.getIndex() + 2, pageReader.getLong(column));
97
+ if (pageReader.isNull(column)) {
98
+ preparedStatement.setObject(column.getIndex() + 2, null);
99
+ } else {
100
+ preparedStatement.setLong(column.getIndex() + 2, pageReader.getLong(column));
101
+ }
96
102
  } catch (SQLException e) {
97
103
  throw new RuntimeException(e);
98
104
  }
@@ -101,8 +107,11 @@ public class CDataPageOutputForUpdate implements TransactionalPageOutput {
101
107
  @Override
102
108
  public void doubleColumn(Column column) {
103
109
  try {
104
- logger.info(column.getName() + ": " + pageReader.getDouble(column));
105
- preparedStatement.setDouble(column.getIndex() + 2, pageReader.getDouble(column));
110
+ if (pageReader.isNull(column)) {
111
+ preparedStatement.setObject(column.getIndex() + 2, null);
112
+ } else {
113
+ preparedStatement.setDouble(column.getIndex() + 2, pageReader.getDouble(column));
114
+ }
106
115
  } catch (SQLException e) {
107
116
  throw new RuntimeException(e);
108
117
  }
@@ -111,11 +120,14 @@ public class CDataPageOutputForUpdate implements TransactionalPageOutput {
111
120
  @Override
112
121
  public void stringColumn(Column column) {
113
122
  try {
114
- logger.info(column.getName() + ": " + pageReader.getString(column));
115
123
  if (Objects.equals(column.getName(), task.getExternalIdColumn())) {
116
124
  currentExternalIdColumn = pageReader.getString(column);
117
125
  }
118
- preparedStatement.setString(column.getIndex() + 2, pageReader.getString(column));
126
+ if (pageReader.isNull(column)) {
127
+ preparedStatement.setObject(column.getIndex() + 2, null);
128
+ } else {
129
+ preparedStatement.setString(column.getIndex() + 2, pageReader.getString(column));
130
+ }
119
131
  } catch (SQLException e) {
120
132
  throw new RuntimeException(e);
121
133
  }
@@ -124,8 +136,11 @@ public class CDataPageOutputForUpdate implements TransactionalPageOutput {
124
136
  @Override
125
137
  public void timestampColumn(Column column) {
126
138
  try {
127
- logger.info(column.getName() + ": " + pageReader.getTimestampInstant(column));
128
- preparedStatement.setTimestamp(column.getIndex() + 2, Timestamp.from(pageReader.getTimestampInstant(column)));
139
+ if (pageReader.isNull(column)) {
140
+ preparedStatement.setObject(column.getIndex() + 2, null);
141
+ } else {
142
+ preparedStatement.setTimestamp(column.getIndex() + 2, Timestamp.from(pageReader.getTimestampInstant(column)));
143
+ }
129
144
  } catch (SQLException e) {
130
145
  throw new RuntimeException(e);
131
146
  }
@@ -134,8 +149,11 @@ public class CDataPageOutputForUpdate implements TransactionalPageOutput {
134
149
  @Override
135
150
  public void jsonColumn(Column column) {
136
151
  try {
137
- logger.info(column.getName() + ": " + pageReader.getString(column));
138
- preparedStatement.setString(column.getIndex() + 2, pageReader.getString(column));
152
+ if (pageReader.isNull(column)) {
153
+ preparedStatement.setObject(column.getIndex() + 2, null);
154
+ } else {
155
+ preparedStatement.setString(column.getIndex() + 2, pageReader.getString(column));
156
+ }
139
157
  } catch (SQLException e) {
140
158
  throw new RuntimeException(e);
141
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.1
4
+ version: 0.3.4
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-06 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.1.jar
52
+ - classpath/embulk-output-cdata-0.3.4.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: {}