[
https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13757098#comment-13757098
]
Koji Noguchi commented on PIG-2315:
-----------------------------------
> because it is not working anyway.
>
There's at least one case it's working for our users.
{noformat}
a = load 'input.txt' as (nb:bag{});
b = foreach a generate flatten(nb) as (year, name:bytearray);
c = filter b by name == 'user1';
dump c;
{noformat}
Above case works. But without the ':bytearray' in relation b, it fails.
{noformat}
a = load 'input.txt' as (nb:bag{});
b = foreach a generate flatten(nb) as (year, name);
c = filter b by name == 'user1';
dump c;
{noformat}
"Front End: ERROR 1052: Cannot cast bytearray to chararray"
Please keep the first case valid. (Thanks [~fuding] for this example.)
Error message in the second case is misleading that it's actually trying to
typecast NULL to chararray.
> Make as clause work in generate
> -------------------------------
>
> Key: PIG-2315
> URL: https://issues.apache.org/jira/browse/PIG-2315
> Project: Pig
> Issue Type: Bug
> Reporter: Olga Natkovich
> Assignee: Gianmarco De Francisci Morales
> Fix For: 0.12
>
>
> Currently, the following syntax is supported and ignored causing confusing
> with users:
> A1 = foreach A1 generate a as a:chararray ;
> After this statement a just retains its previous type
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira