You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sqoop.apache.org by ja...@apache.org on 2014/08/09 19:41:33 UTC

git commit: SQOOP-1423: hcatalog export with --map-column-java fails

Repository: sqoop
Updated Branches:
  refs/heads/trunk c859a5a15 -> e247f76bf


SQOOP-1423: hcatalog export with --map-column-java fails

(Muhammad Ehsan ul Haque via 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/e247f76b
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/e247f76b
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/e247f76b

Branch: refs/heads/trunk
Commit: e247f76bfa1a58e5b39dda686c43e884a49bfadc
Parents: c859a5a
Author: Jarek Jarcec Cecho <ja...@apache.org>
Authored: Sat Aug 9 10:41:04 2014 -0700
Committer: Jarek Jarcec Cecho <ja...@apache.org>
Committed: Sat Aug 9 10:41:04 2014 -0700

----------------------------------------------------------------------
 .../apache/sqoop/mapreduce/hcat/SqoopHCatUtilities.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/e247f76b/src/java/org/apache/sqoop/mapreduce/hcat/SqoopHCatUtilities.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/mapreduce/hcat/SqoopHCatUtilities.java b/src/java/org/apache/sqoop/mapreduce/hcat/SqoopHCatUtilities.java
index 05b454d..b69b83e 100644
--- a/src/java/org/apache/sqoop/mapreduce/hcat/SqoopHCatUtilities.java
+++ b/src/java/org/apache/sqoop/mapreduce/hcat/SqoopHCatUtilities.java
@@ -798,10 +798,16 @@ public final class SqoopHCatUtilities {
     job.setInputFormatClass(getInputFormatClass());
     Map<String, List<Integer>> dbColInfo = hCatUtils.getDbColumnInfo();
     MapWritable columnTypesJava = new MapWritable();
+    Properties mapColumnJava = opts.getMapColumnJava();
     for (Map.Entry<String, List<Integer>> e : dbColInfo.entrySet()) {
       Text columnName = new Text(e.getKey());
-      Text columnText = new Text(connMgr.toJavaType(dbTable, e.getKey(),
-        e.getValue().get(0)));
+      Text columnText = null;
+      if (mapColumnJava.containsKey(e.getKey())) {
+        columnText = new Text(mapColumnJava.getProperty(e.getKey()));
+      } else {
+        columnText = new Text(connMgr.toJavaType(dbTable, e.getKey(),
+          e.getValue().get(0)));
+      }
       columnTypesJava.put(columnName, columnText);
     }
     MapWritable columnTypesSql = new MapWritable();