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

FLATTEN eliminates the alias

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.9.0
    • None
    • None

    Description

      If schema for a field of type 'bag' is partially defined then FLATTEN() incorrectly eliminates the field and throws an error.
      Consider the following example:-

      A = LOAD 'sample' using PigStorage() as (first:chararray, second:chararray, ladder:bag{});
      B = FOREACH A GENERATE first,FLATTEN(ladder) as third,second;
      C = GROUP B by (first,third);

      This throws the error
      ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Invalid alias: third in

      {first: chararray,second: chararray}

      Attachments

        Issue Links

          Activity

            People

              daijy Daniel Dai
              ankur Ankur Bansal
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: