Author: tomwhite
Date: Fri Sep 18 20:34:47 2009
New Revision: 816777
URL: http://svn.apache.org/viewvc?rev=816777&view=rev
Log:
MAPREDUCE-923. Sqoop classpath breaks for jar files with a plus sign in their names. Contributed
by Aaron Kimball.
Modified:
hadoop/mapreduce/trunk/CHANGES.txt
hadoop/mapreduce/trunk/src/contrib/sqoop/src/java/org/apache/hadoop/sqoop/orm/CompilationManager.java
Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=816777&r1=816776&r2=816777&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Fri Sep 18 20:34:47 2009
@@ -681,3 +681,5 @@
MAPREDUCE-941. Vaidya script fails on Solaris. (Chad Metcalf
via tomwhite)
+ MAPREDUCE-923. Sqoop classpath breaks for jar files with a
+ plus sign in their names. (Aaron Kimball via tomwhite)
Modified: hadoop/mapreduce/trunk/src/contrib/sqoop/src/java/org/apache/hadoop/sqoop/orm/CompilationManager.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/contrib/sqoop/src/java/org/apache/hadoop/sqoop/orm/CompilationManager.java?rev=816777&r1=816776&r2=816777&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/contrib/sqoop/src/java/org/apache/hadoop/sqoop/orm/CompilationManager.java
(original)
+++ hadoop/mapreduce/trunk/src/contrib/sqoop/src/java/org/apache/hadoop/sqoop/orm/CompilationManager.java
Fri Sep 18 20:34:47 2009
@@ -339,6 +339,13 @@
if (toReturn.startsWith("file:")) {
toReturn = toReturn.substring("file:".length());
}
+ // URLDecoder is a misnamed class, since it actually decodes
+ // x-www-form-urlencoded MIME type rather than actual
+ // URL encoding (which the file path has). Therefore it would
+ // decode +s to ' 's which is incorrect (spaces are actually
+ // either unencoded or encoded as "%20"). Replace +s first, so
+ // that they are kept sacred during the decoding process.
+ toReturn = toReturn.replaceAll("\\+", "%2B");
toReturn = URLDecoder.decode(toReturn, "UTF-8");
return toReturn.replaceAll("!.*$", "");
}
|