pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Ding (JIRA)" <j...@apache.org>
Subject [jira] [Created] (PIG-2050) Pig can't reference auto-generated schema name for TOTUPLE
Date Fri, 06 May 2011 21:42:03 GMT
Pig can't reference auto-generated schema name for TOTUPLE
----------------------------------------------------------

                 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

Mime
View raw message