pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Feng Peng (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PIG-2937) generated field in nested foreach does not inherit the variable name as the field name
Date Wed, 14 Nov 2012 20:30:14 GMT

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

Feng Peng commented on PIG-2937:
--------------------------------

Great, thanks guys!
                
> generated field in nested foreach does not inherit the variable name as the field name
> --------------------------------------------------------------------------------------
>
>                 Key: PIG-2937
>                 URL: https://issues.apache.org/jira/browse/PIG-2937
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Feng Peng
>            Assignee: Jonathan Coveney
>             Fix For: 0.11, 0.12
>
>         Attachments: PIG-2937-0.patch, PIG-2937-1.patch, PIG-2937-2.patch, PIG-2937-3_nowhitespace.patch,
PIG-2937-3_whitespace.patch
>
>
> {code}
> raw_data = load 'xyz' using Loader() as (field_a, field_b, field_c);
> records = foreach raw_data {
>   generated_field = (field_a is null ? '-' : someUDF(field_b)); 
>   GENERATE
>     field_c,
>     generated_field
>   ;
> }
> describe records;
> {code}
> One would expect the generated_field to have a field name, similar to the field_c that
is from the original relation. However, Pig currently doesn't assign the field name by default.
It'd be nice if we can assign the variable name as the default field name. 

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

Mime
View raw message