From ae8d1c767403bf1a708c1de4cb5e633c3f951c19 Mon Sep 17 00:00:00 2001 From: Kathleen Ting Date: Thu, 1 Mar 2012 19:07:51 +0000 Subject: [PATCH] SQOOP-450. Direct MySQL import can fail when using mysqldump version 5.1.14 or above. (Arvind Prabhakar via Kathleen Ting) git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1295750 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/sqoop/mapreduce/MySQLDumpMapper.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/java/org/apache/sqoop/mapreduce/MySQLDumpMapper.java b/src/java/org/apache/sqoop/mapreduce/MySQLDumpMapper.java index 4ec65ef7..2b94271f 100644 --- a/src/java/org/apache/sqoop/mapreduce/MySQLDumpMapper.java +++ b/src/java/org/apache/sqoop/mapreduce/MySQLDumpMapper.java @@ -103,6 +103,10 @@ public void run() { 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 void run() { 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 // ');'.