You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daniel Dai (JIRA)" <ji...@apache.org> on 2014/03/19 00:44:45 UTC

[jira] [Commented] (PIG-2970) Nested foreach getting incorrect schema when having unrelated inner query

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

Daniel Dai commented on PIG-2970:
---------------------------------

When working on PIG-3807, realize no matter how we push up DanglingNestedNodeRemover, we will still invoke getSchema in LogicalPlanBuilder. [~horaguchi] is right, we shall iterate inner plan sinks to find LOGenerate. This is applicable to LOForeach.getSchema(). After DanglingNestedNodeRemover, it is safe to assume LOGenerate is the only sink, so we don't need to sprawl the change to optimizer. I will bring some of Koji's change in PIG-3807.

> Nested foreach getting incorrect schema when having unrelated inner query
> -------------------------------------------------------------------------
>
>                 Key: PIG-2970
>                 URL: https://issues.apache.org/jira/browse/PIG-2970
>             Project: Pig
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 0.10.0
>            Reporter: Koji Noguchi
>            Assignee: Daniel Dai
>            Priority: Minor
>             Fix For: 0.12.0
>
>         Attachments: PIG-2970-0.patch, PIG-2970-1.patch, PIG-2970-2.patch, pig-2970-trunk-v01.txt, pig-2970-trunk-v02.txt
>
>
> While looking at PIG-2968, hit a weird error message.
> {noformat}
> $ cat -n test/foreach2.pig
>      1  daily = load 'nyse' as (exchange, symbol);
>      2  grpd = group daily by exchange;
>      3  unique = foreach grpd {
>      4          sym = daily.symbol;
>      5          uniq_sym = distinct sym;
>      6          --ignoring uniq_sym result
>      7          generate group, daily;
>      8  };
>      9  describe unique;
>     10  zzz = foreach unique generate group;
>     11  explain zzz;
> % pig -x local -t ColumnMapKeyPrune test/foreach2.pig
> ...
> unique: {symbol: bytearray}
> 2012-10-12 16:55:44,226 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1025: 
> <file test/foreach2.pig, line 10, column 30> Invalid field projection. Projected field [group] does not exist in schema: symbol:bytearray.
> ...
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)