You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Serega Sheypak <se...@gmail.com> on 2014/08/02 21:29:26 UTC

RANK in nested foreach, is it working?

Hi, can't make it work:

flatRank = FOREACH groupedRecs {
    ranked = RANK recs by score DESC;
    filtered = FILTER ranked by $0 <100;
    GENERATE FLATTEN(ranked) as ($0 as rank_val, item_id, r_item_id, score);
}

Error:
Syntax error, unexpected symbol at or near 'RANK'

Re: RANK in nested foreach, is it working?

Posted by Serega Sheypak <se...@gmail.com>.
Yes, I've already found it. Implemented using cusotm code.
Thanks.


2014-08-04 20:10 GMT+04:00 Cheolsoo Park <pi...@gmail.com>:

> No, it's not implemented yet. Here is the jira-
> https://issues.apache.org/jira/browse/PIG-3279
>
>
> On Sat, Aug 2, 2014 at 12:29 PM, Serega Sheypak <se...@gmail.com>
> wrote:
>
> > Hi, can't make it work:
> >
> > flatRank = FOREACH groupedRecs {
> >     ranked = RANK recs by score DESC;
> >     filtered = FILTER ranked by $0 <100;
> >     GENERATE FLATTEN(ranked) as ($0 as rank_val, item_id, r_item_id,
> > score);
> > }
> >
> > Error:
> > Syntax error, unexpected symbol at or near 'RANK'
> >
>

Re: RANK in nested foreach, is it working?

Posted by Cheolsoo Park <pi...@gmail.com>.
No, it's not implemented yet. Here is the jira-
https://issues.apache.org/jira/browse/PIG-3279


On Sat, Aug 2, 2014 at 12:29 PM, Serega Sheypak <se...@gmail.com>
wrote:

> Hi, can't make it work:
>
> flatRank = FOREACH groupedRecs {
>     ranked = RANK recs by score DESC;
>     filtered = FILTER ranked by $0 <100;
>     GENERATE FLATTEN(ranked) as ($0 as rank_val, item_id, r_item_id,
> score);
> }
>
> Error:
> Syntax error, unexpected symbol at or near 'RANK'
>