Pig
  1. Pig
  2. PIG-767

Schema reported from DESCRIBE and actual schema of inner bags are different.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The following script:

      urlContents = LOAD 'inputdir' USING BinStorage() AS (url:bytearray, pg:bytearray);
      – describe and dump are in-sync
      DESCRIBE urlContents;
      DUMP urlContents;

      urlContentsG = GROUP urlContents BY url;
      DESCRIBE urlContentsG;

      urlContentsF = FOREACH urlContentsG GENERATE group,urlContents.pg;

      DESCRIBE urlContentsF;
      DUMP urlContentsF;

      Prints for the DESCRIBE commands:

      urlContents:

      {url: chararray,pg: chararray}

      urlContentsG: {group: chararray,urlContents: {url: chararray,pg: chararray}}
      urlContentsF: {group: chararray,pg: {pg: chararray}}

      The reported schemas for urlContentsG and urlContentsF are wrong. They are also against the section "Schemas for Complex Data Types" in http://wiki.apache.org/pig-data/attachments/FrontPage/attachments/plrm.htm#_Schemas.

      As expected, actual data observed from DUMP urlContentsG and DUMP urlContentsF do contain the tuple inside the inner bags.

      The correct schema for urlContentsG is: {group: chararray,urlContents: {t1:(url: chararray,pg: chararray)}}

      This may sound like a technicality, but it isn't. For instance, a UDF that assumes an inner bag of

      {chararray}

      will not work with

      {(chararray)}

      .

      1. PIG-767-4.patch
        22 kB
        Daniel Dai
      2. PIG-767-3.patch
        21 kB
        Daniel Dai
      3. PIG-767-2.patch
        18 kB
        Daniel Dai
      4. PIG-767-1.patch
        3 kB
        Daniel Dai

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Daniel Dai
              Reporter:
              George Mavromatis
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development