Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-3579

pig.script's deserialized version does not maintain line numbers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      If pig.script is decoded with base64, it loses line numbers because the buffered reader that adds the lines, removes '\n's.

      ScriptState.java#setScript
      protected void setScript(BufferedReader reader) {
              StringBuilder sb = new StringBuilder();
              try {
                  String line = reader.readLine();
                  while (line != null) {
                      if (line.length() > 0) {
                          sb.append(line).append("\n");
                      }
                      line = reader.readLine();
                  }
              } catch (IOException e) {
                  LOG.warn("unable to parse the script", e);
              }
              setScript(sb.toString());
          }
      

      Attachments

        1. PIG-3579.patch
          0.6 kB
          Jiaji Grace Zhang

        Activity

          People

            jgzhang Jiaji Grace Zhang
            aniket486 Aniket Namadeo Mokashi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: