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

Jonathan Coveney commented on PIG-2680:
---------------------------------------

This comes from the current comments on TOBAG:

{code}
 67  *  example 3
 68  *  grunt> describe a;                                                      
       
 69  *  a: {a0: (x: int),a1: (y: int)}
 70  * -- note that the inner schema is different because the alises (x & y) 
are different
 71  *  grunt> b = foreach a generate TOBAG(a0,a1);                             
       
 72  *  grunt> describe b;                                                      
       
 73  *  b: {{NULL}}
{code}

your patch changes that. It's an ok change IMHO, since it is a more permissive 
change and the old version would have forced people to manually cast if the 
schema mattered, but we still need to update the comments accordingly, as in 
the above example, it'd now be b: {{(x:int)}}.
                
> TOBAG output schema reporting
> -----------------------------
>
>                 Key: PIG-2680
>                 URL: https://issues.apache.org/jira/browse/PIG-2680
>             Project: Pig
>          Issue Type: Bug
>          Components: internal-udfs
>    Affects Versions: 0.10.0
>            Reporter: Andy Schlaikjer
>         Attachments: fixes_tobag_input_schema_validation.patch
>
>
> TOBAG only reports an output schema beyond {{{(NULL)}}} when all input field 
> schemas match deeply, including field schema aliases. This seems wrong to me. 
> Shouldn't it just require recursive type equality?
> For relevant code, see:
> http://svn.apache.org/viewvc/pig/tags/release-0.9.2/src/org/apache/pig/builtin/TOBAG.java?view=markup#l142
> {code:java}
>     private boolean nullEquals(Schema currentSchema, Schema newSchema) {
>         if(currentSchema == null){
>             if(newSchema != null){
>                 return false;
>             }
>             return true;
>         }
>         return currentSchema.equals(newSchema);
>     }
> {code}
> The included patch modifies the return line to use 
> {{Schema.equals(currentSchema, newSchema, false, true)}} to avoid alias 
> matching requirement.

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

        

Reply via email to