diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java index 5e0553d..0402440 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java @@ -19,8 +19,10 @@ package org.apache.hadoop.hive.ql.exec; import java.util.ArrayList; + import com.google.common.collect.Lists; import com.google.common.collect.Sets; + import java.beans.DefaultPersistenceDelegate; import java.beans.Encoder; import java.beans.Expression; @@ -35,10 +37,12 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.Serializable; +import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URL; import java.net.URLClassLoader; import java.net.URLDecoder; +import java.net.URLEncoder; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -585,7 +589,12 @@ private static Path getPlanPath(Configuration conf, String name) { if (planPath == null) { return null; } - return new Path(planPath, name); + try { + return new Path(planPath, URLEncoder.encode(name, "UTF-8")); + } catch (UnsupportedEncodingException e) { + LOG.error(e.getMessage()); + } + return null; } private static void setPlanPath(Configuration conf, Path hiveScratchDir) throws IOException {