embulk-output-jdbc 0.2.1 → 0.2.2

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: ad63f756531e91a61059ac0568e2b9d96b47a4fd
4
- data.tar.gz: 0e2d9ccc4f4f40bd5439ba8639f462583b194f80
3
+ metadata.gz: b00ca29d7e5aac5ac1369fe312807937c0953336
4
+ data.tar.gz: 7fd2236f250fd4d24e825a3d974326e60f163b76
5
5
  SHA512:
6
- metadata.gz: 629fca902b6c03d39c3a87ff7276f31d6028f1743acde07ee573a911fd8d0dac1050d793e3aaf23de4f0084d6ef4b475d819d3bc5652256f7484cd8d0fcce616
7
- data.tar.gz: 6d296929dd913354ffc58f7c4cf59b1a67a5bd020f3a5a9ca00ba8c7080673d37a9c6d37df1c730fb24a6244c76556f18229d77285d2e3addd16a5a99e66d0bc
6
+ metadata.gz: 3f09b8a3a96a5df1fb9bb7a00619399fccaca549be880f7729ed155f146f5f6a06ac394cea4187b059b7a938115b9986e18e3ccefef5cccb6a32e1d23c9ea64d
7
+ data.tar.gz: 61d57fc29b2816f9809b1dbacc807b55569ec252e4ad55f442b392777738b0732fdf853da1918c7f0f14f8c0e8fd6953676ae35e312ddc3771f47232bbf243b9
@@ -203,7 +203,7 @@ public abstract class AbstractJdbcOutputPlugin
203
203
  return commit(task, schema, taskCount);
204
204
  }
205
205
 
206
- private String getTransactionUniqueName()
206
+ protected String getTransactionUniqueName()
207
207
  {
208
208
  // TODO use uuid?
209
209
  Timestamp t = Exec.session().getTransactionTime();
@@ -453,9 +453,20 @@ public abstract class AbstractJdbcOutputPlugin
453
453
 
454
454
  private JdbcSchema matchSchemaByColumnNames(Schema inputSchema, JdbcSchema targetTableSchema)
455
455
  {
456
- // TODO for each inputSchema.getColumns(), search a column whose name
457
- // matches with targetTableSchema. if not match, create JdbcSchema.skipColumn().
458
- return targetTableSchema;
456
+ ImmutableList.Builder<JdbcColumn> jdbcColumns = ImmutableList.builder();
457
+
458
+ outer : for (Column column : inputSchema.getColumns()) {
459
+ for (JdbcColumn jdbcColumn : targetTableSchema.getColumns()) {
460
+ if (jdbcColumn.getName().equals(column.getName())) {
461
+ jdbcColumns.add(jdbcColumn);
462
+ continue outer;
463
+ }
464
+ }
465
+
466
+ jdbcColumns.add(JdbcColumn.skipColumn());
467
+ }
468
+
469
+ return new JdbcSchema(jdbcColumns.build());
459
470
  }
460
471
 
461
472
  public TransactionalPageOutput open(TaskSource taskSource, Schema schema, final int taskIndex)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-jdbc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
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-03-15 00:00:00.000000000 Z
11
+ date: 2015-04-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Inserts or updates records to a table.
14
14
  email:
@@ -39,7 +39,7 @@ files:
39
39
  - src/main/java/org/embulk/output/jdbc/setter/SqlTimestampColumnSetter.java
40
40
  - src/main/java/org/embulk/output/jdbc/setter/StringColumnSetter.java
41
41
  - src/test/java/org/embulk/output/TestJdbcOutputPlugin.java
42
- - classpath/embulk-output-jdbc-0.2.1.jar
42
+ - classpath/embulk-output-jdbc-0.2.2.jar
43
43
  homepage: https://github.com/embulk/embulk-output-jdbc
44
44
  licenses:
45
45
  - Apache 2.0