[ 
https://issues.apache.org/jira/browse/PIG-1673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thejas M Nair updated PIG-1673:
-------------------------------

    Attachment: PIG-1673.1.patch

The root cause for the issue was that the logical plan during parsing of a 
statement does not have the entire plan that has been generated at that point, 
and in case of union-onschema LogicalPlanValidator was being called with this 
partial plan.
When there were two consecutive union-onschema in the plan, code in 
TypeCheckingVisitor.insertCastForEachInBetweenIfNecessary assumes that 
predecessors of the firs LOUnion are available in the logical plan and it ends 
up throwing a NullPointerException .
Another issue caused by same root cause, was that the correct types would not 
be available in the parser at the point where union-onschema adds foreach 
statements and casts to the plan. 
To address this problem, the patch moves most of the code for union-onschema in 
the parser to a visitor which is run from PigServer.compileLp(). The visitor 
has access to the the complete logical plan.


> query with consecutive union-onschema statement errors out
> ----------------------------------------------------------
>
>                 Key: PIG-1673
>                 URL: https://issues.apache.org/jira/browse/PIG-1673
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.8.0
>            Reporter: Thejas M Nair
>            Assignee: Thejas M Nair
>             Fix For: 0.8.0
>
>         Attachments: PIG-1673.1.patch
>
>
> grunt> l = load 't.txt' as (a,b);
> grunt> f1 = foreach l generate (chararray)a;
> grunt> u = union onschema f1, l;
> grunt> u2 = union onschema u, f1;
> 2010-10-07 11:13:17,348 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 
> 1000: Error during parsing. null
> Details at logfile: /Users/tejas/pig-0.8/branch-0.8/pig_1286475169418.log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to