sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kathl...@apache.org
Subject svn commit: r1295750 - /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/MySQLDumpMapper.java
Date Thu, 01 Mar 2012 19:07:51 GMT
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
             // ');'.



Mime
View raw message