An error in new parser
----------------------

                 Key: PIG-1920
                 URL: https://issues.apache.org/jira/browse/PIG-1920
             Project: Pig
          Issue Type: Bug
          Components: impl
    Affects Versions: 0.9.0
            Reporter: Richard Ding
            Assignee: Xuefu Zhang
             Fix For: 0.9.0


Run following Pig script on trunk:

{code}
A = load 'input' as (v, u);
B = group A by $0;
C = group B by $0;
describe C;
R = foreach C generate B.A.v; 
describe R;
{code}

One gets the this error:

{code}
C: {group: bytearray,B: {(group: bytearray,A: {(v: bytearray,u: bytearray)})}}
[main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Invalid field 
reference. Referenced field [v] does not exist in schema: 
A#19:bag{null#20:tuple(v#17:bytearray,u#18:bytearray)}.
{code}

Change the 5th line to 

{code}
R = foreach C generate B.A.$0; 
{code}

One gets this output:

{code}
C: {group: bytearray,B: {(group: bytearray,A: {(v: bytearray,u: bytearray)})}}
R: {{(A: {(v: bytearray,u: bytearray)})}}
{code}

This is different (and wrong) from the corresponding Pig 0.8 output:

{code}
C: {group: bytearray,B: {group: bytearray,A: {v: bytearray,u: bytearray}}}
R: {{v: bytearray}}
{code}


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to