5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-03 22:34:30 +08:00

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

(Muhammad Ehsan ul Haque via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2014-08-09 10:41:04 -07:00
parent c859a5a15d
commit e247f76bfa

View File

@ -798,10 +798,16 @@ public static void configureExportInputFormat(SqoopOptions opts, Job job,
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(),
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();