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

pig corrupts chararrays with trailing whitespace when converting them to long

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.10.0
    • 0.12.0
    • data
    • None
    • Reviewed

    Description

      when trying to convert the following string into long, pig corrupts it. data:

      1703598819951657279 ,44081037

      data1 = load 'data' using CSVLoader as (a: chararray ,b: int);
      data2 = foreach data1 generate (long)a as a;
      dump data2;
      (1703598819951657216) <--- last 2 digits are corrupted

      data2 = foreach data1 generate (long)TRIM(a) as a;
      dump data2;
      (1703598819951657279) <--- correct

      Attachments

        1. PIG-3110.patch
          6 kB
          Prashant Kommireddi

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            prkommireddi Prashant Kommireddi
            ihadanny Ido Hadanny
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment