diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java index d59ca8c..533a4ab 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java @@ -314,15 +314,17 @@ public static void clearWork(Configuration conf) { return; } + try { - FileSystem fs = mapPath.getFileSystem(conf); - if (fs.exists(mapPath)) { - fs.delete(mapPath, true); - } - if (fs.exists(reducePath)) { - fs.delete(reducePath, true); + if (!HiveConf.getBoolVar(conf, ConfVars.HIVE_RPC_QUERY_PLAN)) { + FileSystem fs = mapPath.getFileSystem(conf); + if (fs.exists(mapPath)) { + fs.delete(mapPath, true); + } + if (fs.exists(reducePath)) { + fs.delete(reducePath, true); + } } - } catch (Exception e) { LOG.warn("Failed to clean-up tmp directories.", e); } finally {