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

Santhosh Srinivasan commented on PIG-359:
-----------------------------------------

In POUserFunc.java, the following code makes an assumption that project( * ) 
always returns a tuple. In the foreach nested block, we could be projecting 
bags, at which point the code will fail with ClassCastException. E.g: 
testNestedPlan in TestEvalPipeline.java

{code}
                
+                if(op instanceof POProject){
+                    POProject projOp = (POProject)op;
+                    if(projOp.isStar()){
+                        Tuple trslt = (Tuple) temp.result;
+                        Tuple rslt = (Tuple) res.result;
+                        for(int i=0;i<trslt.size();i++)
+                            rslt.append(trslt.get(i));
+                        continue;
+                    }
+                }
{code}

> Semantics of generate * have changed
> ------------------------------------
>
>                 Key: PIG-359
>                 URL: https://issues.apache.org/jira/browse/PIG-359
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: types_branch
>            Reporter: Alan Gates
>            Assignee: Shravan Matthur Narayanamurthy
>             Fix For: types_branch
>
>         Attachments: 359-1.patch, 359.patch
>
>
> In the main trunk, the script
> A = load 'myfile';
> B = foreach A generate *;
> returns:
> (x, y, z)
> In the types branch, it returns:
> ((x, y, z))
> There is an extra level of tuple in it.  In the main branch generate * seems 
> to include an implicit flatten.

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