Review Board 1.7.22


HIVE-3810: HiveHistory.log need to replace '\r' with space before writing Entry.value to historyfile

Review Request #9129 - Created Jan. 28, 2013 and submitted

Mark Grover
trunk
HIVE-3810
Reviewers
hive
ashutoshc
hive-git
Line ending changes to make Hive work across multiple OSs

 

Diff revision 1 (Latest)

  1. ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java: Loading...
ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java
Revision 7e80c2d New Change
[20] 283 lines
[+20] [+] public String getHistFileName() {
284

    
   
284

   
285
      sb.append(DELIMITER);
285
      sb.append(DELIMITER);
286
      String key = ent.getKey();
286
      String key = ent.getKey();
287
      String val = ent.getValue();
287
      String val = ent.getValue();
288
      if(val != null) {
288
      if(val != null) {
289
        val = val.replace('\n', ' ');
289
        // Get rid of windows style line endings first, if any

    
   
290
        val = val.replace("\r\n", " ");

    
   
291
        // Change the remaining mac or linux style line endings

    
   
292
        val = val.replace('\r',' ').replace('\n', ' ');
290
      }
293
      }
291
      sb.append(key + "=\"" + val + "\"");
294
      sb.append(key + "=\"" + val + "\"");
292

    
   
295

   
293
    }
296
    }
294
    sb.append(DELIMITER);
297
    sb.append(DELIMITER);
[+20] [20] 244 lines
  1. ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistory.java: Loading...