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:
parent
c859a5a15d
commit
e247f76bfa
@ -798,10 +798,16 @@ public static void configureExportInputFormat(SqoopOptions opts, Job job,
|
|||||||
job.setInputFormatClass(getInputFormatClass());
|
job.setInputFormatClass(getInputFormatClass());
|
||||||
Map<String, List<Integer>> dbColInfo = hCatUtils.getDbColumnInfo();
|
Map<String, List<Integer>> dbColInfo = hCatUtils.getDbColumnInfo();
|
||||||
MapWritable columnTypesJava = new MapWritable();
|
MapWritable columnTypesJava = new MapWritable();
|
||||||
|
Properties mapColumnJava = opts.getMapColumnJava();
|
||||||
for (Map.Entry<String, List<Integer>> e : dbColInfo.entrySet()) {
|
for (Map.Entry<String, List<Integer>> e : dbColInfo.entrySet()) {
|
||||||
Text columnName = new Text(e.getKey());
|
Text columnName = new Text(e.getKey());
|
||||||
Text columnText = new Text(connMgr.toJavaType(dbTable, e.getKey(),
|
Text columnText = null;
|
||||||
e.getValue().get(0)));
|
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);
|
columnTypesJava.put(columnName, columnText);
|
||||||
}
|
}
|
||||||
MapWritable columnTypesSql = new MapWritable();
|
MapWritable columnTypesSql = new MapWritable();
|
||||||
|
Loading…
Reference in New Issue
Block a user