You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daniel Dai (Resolved) (JIRA)" <ji...@apache.org> on 2012/03/15 19:27:40 UTC

[jira] [Resolved] (PIG-2216) deprecate use of type in as clause of foreach statement

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

Daniel Dai resolved PIG-2216.
-----------------------------

    Resolution: Duplicate

This is the same issue of PIG-2315. Mark this issue as duplicate.
                
> deprecate use of type in as clause of foreach statement
> -------------------------------------------------------
>
>                 Key: PIG-2216
>                 URL: https://issues.apache.org/jira/browse/PIG-2216
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Thejas M Nair
>
> In the as clause of foreach statement, type can be specified, but that type is actually not used (ie, it does not result in a cast). This behavior is misleading.
> {code}
> F = foreach INP generate c1 as (name : chararray);
> {code}
> Pig 0.8 produces an error if c1 in above example is not of same type as specified in the as clause.
> In 0.9, that check seems to have been lost in the parser migration. It also results in the logical plan thinking that the type of c1 is that specified in the as clause. That can cause errors such as ClassCastException. 
> One way to be consistent here would have been to add cast for the as clause as well. But having two ways to cast complicates things. So long term, I think the use of types in as clause should be removed.
> For 0.10, i think the check present in 0.8 should be added back, and the syntax should be deprecated (resulting in a warning when used).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira