sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hshreedha...@apache.org
Subject git commit: SQOOP-1107. Further improve error reporting when exporting malformed data
Date Sat, 31 Aug 2013 01:55:08 GMT
Updated Branches:
  refs/heads/trunk 127d2ddec -> 15ae44016


SQOOP-1107. Further improve error reporting when exporting malformed data

(Jarek Jarcec Cecho via Hari Shreedharan)


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

Branch: refs/heads/trunk
Commit: 15ae44016d94bcb4eb1c9e965d8424d395b3b959
Parents: 127d2dd
Author: Hari Shreedharan <hshreedharan@cloudera.com>
Authored: Fri Aug 30 18:54:13 2013 -0700
Committer: Hari Shreedharan <hshreedharan@cloudera.com>
Committed: Fri Aug 30 18:54:13 2013 -0700

----------------------------------------------------------------------
 src/java/org/apache/sqoop/orm/ClassWriter.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/15ae4401/src/java/org/apache/sqoop/orm/ClassWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/orm/ClassWriter.java b/src/java/org/apache/sqoop/orm/ClassWriter.java
index 7fdf434..0adc718 100644
--- a/src/java/org/apache/sqoop/orm/ClassWriter.java
+++ b/src/java/org/apache/sqoop/orm/ClassWriter.java
@@ -1030,11 +1030,16 @@ public class ClassWriter {
     // 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");
   }
 


Mime
View raw message