diff --git ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java index 7e80c2d..a14dcd0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java +++ ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java @@ -286,7 +286,10 @@ public class HiveHistory { String key = ent.getKey(); String val = ent.getValue(); if(val != null) { - val = val.replace('\n', ' '); + // Get rid of windows style line endings first, if any + val = val.replace("\r\n", " "); + // Change the remaining mac or linux style line endings + val = val.replace('\r',' ').replace('\n', ' '); } sb.append(key + "=\"" + val + "\"");