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

Casting from bytearray failing after Union (even when each field is from a single Loader)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.13.0
    • parser
    • None
    • Reviewed
    • Before, LoadCaster after Union was only available when two union-ed relations were from the same Loader with same parameters. Now, LoadCaster would work for cases when Loaders return the same LoadCaster that only have a default constructor.

    Description

      One example

      A = load 'data1.txt' as line:bytearray;
      B = load 'c1.txt' using TextLoader() as cookie1;
      C = load 'c2.txt' using TextLoader() as cookie2;
      B2 = join A by line, B by cookie1;
      C2 = join A by line, C by cookie2;
      D = union onschema B2,C2; -- D: {A::line: bytearray,B::cookie1: bytearray,C::cookie2: bytearray}
      E = foreach D generate (chararray) line, (chararray) cookie1, (chararray) cookie2;
      dump E;
      

      This script fails at runtime with
      "Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 1075: Received a bytearray from the UDF. Cannot determine how to convert the bytearray to string."

      This is different from PIG-3293 such that each field in 'D' belongs to a single loader whereas on PIG-3293, it came from multiple loader.

      Attachments

        1. pig-3295-v01.patch
          20 kB
          Koji Noguchi
        2. pig-3295-v02.patch
          20 kB
          Koji Noguchi
        3. pig-3295-v03.patch
          35 kB
          Koji Noguchi
        4. pig-3295-v04.patch
          34 kB
          Koji Noguchi
        5. pig-3295-v05.patch
          34 kB
          Koji Noguchi
        6. pig-3295-v06.patch
          62 kB
          Koji Noguchi
        7. pig-3295-v07.patch
          63 kB
          Koji Noguchi

        Issue Links

          Activity

            People

              knoguchi Koji Noguchi
              knoguchi Koji Noguchi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: