You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Alan Gates (JIRA)" <ji...@apache.org> on 2011/07/16 00:06:00 UTC

[jira] [Commented] (PIG-2050) Pig shows auto-generated schema name for TOTUPLE in describe

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

Alan Gates commented on PIG-2050:
---------------------------------

The issue here is not that the user cannot access the tuple by this name, but that the name shows up in describe.  The semantics of Pig Latin are that if the user does not name an expression in foreach and it is not a simple column expression, then it has no name.  But describe should not show this internal name that Pig is using, as that is confusing.

> Pig shows auto-generated schema name for TOTUPLE in describe
> ------------------------------------------------------------
>
>                 Key: PIG-2050
>                 URL: https://issues.apache.org/jira/browse/PIG-2050
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.8.0, 0.9.0
>            Reporter: Richard Ding
>            Priority: Minor
>
> Here is the use case:
> {code}
> grunt> A = load 'data' as (a0, a1, a2); 
> grunt> B = foreach A generate TOTUPLE(a0, a2);      
> grunt> describe B
> B: {org.apache.pig.builtin.totuple_a0_3: (a0: bytearray,a2: bytearray)}
> grunt> C = foreach B generate org.apache.pig.builtin.totuple_a0_3;
> 2011-05-06 14:38:14,635 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Invalid alias: org in {org.apache.pig.builtin.totuple_a0_1: (a0: bytearray,a2: bytearray)}
> {code}
> The workaround is to specify a use-defined schema name:
> {code}
> grunt> A = load 'data' as (a0, a1, a2);                                              
> grunt> B = foreach A generate TOTUPLE(a0, a2) as aa;              
> grunt> describe B                                                 
> B: {aa: (a0: bytearray,a2: bytearray)}
> grunt> C = foreach B generate aa;                                 
> grunt> 
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira