embulk-input-jdbc 0.6.3 → 0.6.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: 180e855fc538b6686ff6c644e83e54399c6c040f
4
- data.tar.gz: 21293c5bc4438c2c52fe21e00ecb88204eae8981
3
+ metadata.gz: d64ee420864ebfe1de416471638a0df1348f9338
4
+ data.tar.gz: 79cfb08db0a917123d6964e2670b7df9d17b060a
5
5
  SHA512:
6
- metadata.gz: 1a543fdf561b51296d5eb08052b71662ae1f9ee901160ebc093d4f8ecb254f73ed89d621f271e171bf54932701516848caf30b7d58ff093e8ec647c1ffacf67b
7
- data.tar.gz: 34c2d0c340f462ff2f0d2670d9f4993eb8cec044d5fd54d17b148bf85e97c39f91ab1ee90b637c445ec88c16845d932351950d3ace344d9b8a47ca23b3a87b28
6
+ metadata.gz: 625c73db1ce05cd04aad35bf9a2da954f42a4042aab27009ae85029b84d845480413e6b6fad547474ac39bd495654d3e90ffb57ddda12ec00fe38144272fa008
7
+ data.tar.gz: dff6a93e278ad1a3803c142135164260d451c3c77de796f901a22d26a39b552f3f0247a42e1aa8193c01177e0c832ff2c58542da94e5b955a946de054c0c1039
@@ -158,7 +158,9 @@ public abstract class AbstractJdbcInputPlugin
158
158
  private Schema setupTask(JdbcInputConnection con, PluginTask task) throws SQLException
159
159
  {
160
160
  // build SELECT query and gets schema of its result
161
- JdbcSchema querySchema = con.getSchemaOfQuery(getQuery(task, con));
161
+ String query = getQuery(task, con);
162
+ logger.info("SQL: " + query);
163
+ JdbcSchema querySchema = con.getSchemaOfQuery(query);
162
164
  task.setQuerySchema(querySchema);
163
165
 
164
166
  // validate column_options
@@ -73,7 +73,6 @@ public class JdbcInputConnection
73
73
 
74
74
  protected BatchSelect newBatchSelect(String query, int fetchRows, int queryTimeout) throws SQLException
75
75
  {
76
- logger.info("SQL: " + query);
77
76
  PreparedStatement stmt = connection.prepareStatement(query);
78
77
  stmt.setFetchSize(fetchRows);
79
78
  stmt.setQueryTimeout(queryTimeout);
@@ -145,6 +144,11 @@ public class JdbcInputConnection
145
144
  return identifierQuoteString + str + identifierQuoteString;
146
145
  }
147
146
 
147
+ protected String buildTableName(String tableName)
148
+ {
149
+ return quoteIdentifierString(tableName);
150
+ }
151
+
148
152
  public String buildSelectQuery(String tableName,
149
153
  Optional<String> selectColumnList, Optional<String> whereCondition,
150
154
  Optional<String> orderByColumn)
@@ -153,7 +157,7 @@ public class JdbcInputConnection
153
157
 
154
158
  sb.append("SELECT ");
155
159
  sb.append(selectColumnList.or("*"));
156
- sb.append(" FROM ").append(quoteIdentifierString(tableName));
160
+ sb.append(" FROM ").append(buildTableName(tableName));
157
161
  if (whereCondition.isPresent()) {
158
162
  sb.append(" WHERE ").append(whereCondition.get());
159
163
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-jdbc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-14 00:00:00.000000000 Z
11
+ date: 2016-01-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Selects records from a table.
14
14
  email:
@@ -40,7 +40,7 @@ files:
40
40
  - src/main/java/org/embulk/input/jdbc/getter/StringColumnGetter.java
41
41
  - src/main/java/org/embulk/input/jdbc/getter/TimeColumnGetter.java
42
42
  - src/main/java/org/embulk/input/jdbc/getter/TimestampColumnGetter.java
43
- - classpath/embulk-input-jdbc-0.6.3.jar
43
+ - classpath/embulk-input-jdbc-0.6.4.jar
44
44
  homepage: https://github.com/embulk/embulk-input-jdbc
45
45
  licenses:
46
46
  - Apache 2.0