You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sqoop.apache.org by ka...@apache.org on 2012/03/01 20:07:51 UTC
svn commit: r1295750 -
/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/MySQLDumpMapper.java
Author: kathleen
Date: Thu Mar 1 19:07:51 2012
New Revision: 1295750
URL: http://svn.apache.org/viewvc?rev=1295750&view=rev
Log:
SQOOP-450. Direct MySQL import can fail when using mysqldump version 5.1.14 or above.
(Arvind Prabhakar via Kathleen Ting)
Modified:
incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/MySQLDumpMapper.java
Modified: incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/MySQLDumpMapper.java
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/MySQLDumpMapper.java?rev=1295750&r1=1295749&r2=1295750&view=diff
==============================================================================
--- incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/MySQLDumpMapper.java (original)
+++ incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/MySQLDumpMapper.java Thu Mar 1 19:07:51 2012
@@ -103,6 +103,10 @@ public class MySQLDumpMapper
break; // EOF.
}
+ if (inLine.trim().length() == 0 || inLine.startsWith("--")) {
+ continue; // comments and empty lines are ignored
+ }
+
// this line is of the form "INSERT .. VALUES ( actual value text
// );" strip the leading preamble up to the '(' and the trailing
// ');'.
@@ -236,6 +240,10 @@ public class MySQLDumpMapper
break; // EOF.
}
+ if (inLine.trim().length() == 0 || inLine.startsWith("--")) {
+ continue; // comments and empty lines are ignored
+ }
+
// this line is of the form "INSERT .. VALUES ( actual value text
// );" strip the leading preamble up to the '(' and the trailing
// ');'.