sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject [4/10] git commit: SQOOP-781 Improve logging in GenericJdbcImportInitializer (Jarek Jarcec Cecho)
Date Tue, 18 Dec 2012 02:46:11 GMT
SQOOP-781 Improve logging in GenericJdbcImportInitializer
(Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/9c08b303
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/9c08b303
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/9c08b303

Branch: refs/heads/branch-1.99.1
Commit: 9c08b303232ca2179f075cd57927dc9b2ae72c0b
Parents: b9b5bf9
Author: Bilung Lee <blee@apache.org>
Authored: Mon Dec 17 13:24:40 2012 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Mon Dec 17 17:37:52 2012 -0800

----------------------------------------------------------------------
 .../jdbc/GenericJdbcImportInitializer.java         |   24 ++++++++-------
 1 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/9c08b303/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java
----------------------------------------------------------------------
diff --git a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java
b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java
index 3ce6bb9..3b697b6 100644
--- a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java
+++ b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java
@@ -191,15 +191,15 @@ public class GenericJdbcImportInitializer extends Initializer {
 
       rs.next();
 
-      context.setString(
-          GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
-          String.valueOf(rsmd.getColumnType(1)));
-      context.setString(
-          GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
-          rs.getString(1));
-      context.setString(
-          GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
-          rs.getString(2));
+      int columnType = rsmd.getColumnType(1);
+      String min = rs.getString(1);
+      String max = rs.getString(2);
+
+      LOG.info("Boundaries: min=" + min + ", max=" + max + ", columnType=" + columnType);
+
+      context.setInteger(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
columnType);
+      context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
min);
+      context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
max);
 
     } catch (SQLException e) {
       throw new SqoopException(
@@ -290,8 +290,10 @@ public class GenericJdbcImportInitializer extends Initializer {
           GenericJdbcConnectorError.GENERIC_JDBC_CONNECTOR_0008);
     }
 
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_DATA_SQL,
-        dataSql.toString());
+    LOG.info("Using dataSql: " + dataSql);
+    LOG.info("Field names: " + fieldNames);
+
+    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_DATA_SQL, dataSql);
     context.setString(Constants.JOB_ETL_FIELD_NAMES, fieldNames);
   }
 }


Mime
View raw message