You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Thejas M Nair (JIRA)" <ji...@apache.org> on 2011/03/16 18:55:29 UTC

[jira] Commented: (PIG-1910) incorrect schema shown when project-star is used with other projections

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

Thejas M Nair commented on PIG-1910:
------------------------------------

This can also lead to incorrect query plan, if an alias that occurs after the position corresponding to * projection in schema is used. -


{code}
grunt> l = load 'x' ;                                       
grunt> f = foreach l generate $1 as a, *, $2 as b;          
grunt> describe f;
f: {a: bytearray,(null),b: bytearray}
grunt> g  = foreach f generate b;
grunt> explain g;
-- NOTE that alias b is getting translated to column index 2, which is incorrect.
...
...
#--------------------------------------------------
# Map Reduce Plan
#--------------------------------------------------
MapReduce node scope-20
Map Plan
g: Store(fakefile:org.apache.pig.builtin.PigStorage) - scope-19
|
|---g: New For Each(false)[bag] - scope-18
    |   |
    |   Project[bytearray][2] - scope-16
    |
    |---f: New For Each(false,true,false)[bag] - scope-15
        |   |
        |   Project[bytearray][1] - scope-9
        |   |
        |   Project[tuple][*] - scope-11
        |   |
        |   Project[bytearray][2] - scope-13
        |
        |---l: Load(file:///Users/tejas/pig_type/trunk/x:org.apache.pig.builtin.PigStorage) - scope-8--------
Global sort: false
----------------

{code}

This problem will also need to be addressed for the range-projection feature in PIG-1693 .

> incorrect schema shown when project-star is used with other projections
> -----------------------------------------------------------------------
>
>                 Key: PIG-1910
>                 URL: https://issues.apache.org/jira/browse/PIG-1910
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Thejas M Nair
>             Fix For: 0.9.0
>
>
> {code}
> grunt> l = load 'x' ;                                       
> grunt> f = foreach l generate $1 as a, *, $2 as b;          
> grunt> describe f;
> f: {a: bytearray,(null),b: bytearray}  -- The tuple returned by * is automatically flattened, so this schema is not correct. It is more accurate to return a null schema.
> {code}

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