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

Nested foreach getting incorrect schema when having unrelated inner query

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.10.0
    • 0.12.0
    • parser
    • None
    • Reviewed

    Description

      While looking at PIG-2968, hit a weird error message.

      $ cat -n test/foreach2.pig
           1  daily = load 'nyse' as (exchange, symbol);
           2  grpd = group daily by exchange;
           3  unique = foreach grpd {
           4          sym = daily.symbol;
           5          uniq_sym = distinct sym;
           6          --ignoring uniq_sym result
           7          generate group, daily;
           8  };
           9  describe unique;
          10  zzz = foreach unique generate group;
          11  explain zzz;
      
      % pig -x local -t ColumnMapKeyPrune test/foreach2.pig
      ...
      unique: {symbol: bytearray}
      
      2012-10-12 16:55:44,226 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1025: 
      <file test/foreach2.pig, line 10, column 30> Invalid field projection. Projected field [group] does not exist in schema: symbol:bytearray.
      ...
      

      Attachments

        1. pig-2970-trunk-v01.txt
          2 kB
          Koji Noguchi
        2. pig-2970-trunk-v02.txt
          10 kB
          Koji Noguchi
        3. PIG-2970-0.patch
          0.6 kB
          Daniel Dai
        4. PIG-2970-1.patch
          6 kB
          Daniel Dai
        5. PIG-2970-2.patch
          4 kB
          Daniel Dai

        Issue Links

          Activity

            People

              daijy Daniel Dai
              knoguchi Koji Noguchi
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: