Hive
  1. Hive
  2. HIVE-3810

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.12.0
    • Component/s: Logging
    • Labels:
      None

      Description

      HiveHistory.log will replace '\n' with space before writing Entry.value to history file:

      val = val.replace('\n', ' ');

      but HiveHistory.parseHiveHistory use BufferedReader.readLine which takes '\n', '\r', '\r\n' as line delimiter to parse history file

      if val contains '\r', there is a high possibility that HiveHistory.parseLine will fail, in which case usually RecordTypes.valueOf(recType) will throw exception 'java.lang.IllegalArgumentException'

      HiveHistory.log need to replace '\r' with space as well:

      val = val.replace('\n', ' ');

      changed to

      val = val.replaceAll("\r|\n", " ");

      or

      val = val.replace('\r', ' ').replace('\n', ' ');

      1. HIVE-3810.1.patch
        0.7 kB
        Mark Grover
      2. HIVE-3810.2.patch
        0.7 kB
        Mark Grover
      3. HIVE-3810.3.patch
        0.8 kB
        Mark Grover
      4. HIVE-3810.4.patch
        0.6 kB
        Mark Grover

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Mark Grover
            Reporter:
            qiangwang
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development