mirror of
https://github.com/apache/sqoop.git
synced 2025-05-03 02:32:23 +08:00
SQOOP-1107. Further improve error reporting when exporting malformed data
(Jarek Jarcec Cecho via Hari Shreedharan)
This commit is contained in:
parent
127d2ddec1
commit
15ae44016d
@ -1030,11 +1030,16 @@ private void generateParser(Map<String, Integer> columnTypes,
|
||||
// method is type-dependent for the fields.
|
||||
sb.append(" private void __loadFromFields(List<String> fields) {\n");
|
||||
sb.append(" Iterator<String> __it = fields.listIterator();\n");
|
||||
sb.append(" String __cur_str;\n");
|
||||
sb.append(" String __cur_str = null;\n");
|
||||
sb.append(" try {\n");
|
||||
for (String colName : colNames) {
|
||||
int colType = columnTypes.get(colName);
|
||||
parseColumn(colName, colType, sb);
|
||||
}
|
||||
sb.append(" } catch (RuntimeException e) {");
|
||||
sb.append(" throw new RuntimeException("
|
||||
+ "\"Can't parse input data: '\" + __cur_str + \"'\", e);");
|
||||
sb.append(" }");
|
||||
sb.append(" }\n\n");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user