[ 
https://issues.apache.org/jira/browse/PIG-1695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12926495#action_12926495
 ] 

Thejas M Nair commented on PIG-1695:
------------------------------------

+1

With this fix, pig does not merge the foreach statements if first foreach has a 
user defined schema. We should consider supporting that case as well (in a 
separate jira), because users sometimes add a foreach statement just to give 
convenient names for columns . 
eg- 
{code}
J = join A by col1, B by col1
F1 = foreach J generate A::col1 as Acol1 , A::col2 as col2, B::col1 as Bcol1; 
-- foreach that has been added just to give convenient names for expressions.
F2 = foreach F1 generate Acol1+col2, Bcol1 + col2 ;
{code}

> MergeForEach does not carry user defined schema if any one of the merged 
> ForEach has user defined schema
> --------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-1695
>                 URL: https://issues.apache.org/jira/browse/PIG-1695
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.8.0
>            Reporter: Daniel Dai
>            Assignee: Daniel Dai
>             Fix For: 0.8.0
>
>         Attachments: PIG-1695-1.patch
>
>
> The following script missing the column name i after merge.
> {code}
> a = load 'num.txt' as (i);
> b = foreach a generate (int)i;
> c = foreach b generate i + 60 as i;
> store c into 'sectest';
> {code}

-- 
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