You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by 李运田 <cu...@163.com> on 2015/09/13 05:49:39 UTC

group all Reverse order

when I use group all,I find that the order reverses. is there a setting I can use not to Reverse order.
data:
(1,a)
(2,b)
(all,{(2,b),(1,a)})
BUT I want to get
(all,{(1,a),(2,b)})


Is there a setting?  thanks


Re: group all Reverse order

Posted by Santosh Pingale <pi...@gmail.com>.
Do you want to keep input order as it is.. or do you want the list to be
sorted?

On Mon, Sep 14, 2015 at 8:30 PM, Rohini Palaniswamy <rohini.aditya@gmail.com
> wrote:

> You will have to use a ORDER BY inside nested foreach after the GROUP
> statement.
>
> On Sat, Sep 12, 2015 at 8:49 PM, 李运田 <cu...@163.com> wrote:
>
> > when I use group all,I find that the order reverses. is there a setting I
> > can use not to Reverse order.
> > data:
> > (1,a)
> > (2,b)
> > (all,{(2,b),(1,a)})
> > BUT I want to get
> > (all,{(1,a),(2,b)})
> >
> >
> > Is there a setting?  thanks
> >
> >
>

Re: group all Reverse order

Posted by Rohini Palaniswamy <ro...@gmail.com>.
You will have to use a ORDER BY inside nested foreach after the GROUP
statement.

On Sat, Sep 12, 2015 at 8:49 PM, 李运田 <cu...@163.com> wrote:

> when I use group all,I find that the order reverses. is there a setting I
> can use not to Reverse order.
> data:
> (1,a)
> (2,b)
> (all,{(2,b),(1,a)})
> BUT I want to get
> (all,{(1,a),(2,b)})
>
>
> Is there a setting?  thanks
>
>

Re: group all Reverse order

Posted by Rohini Palaniswamy <ro...@gmail.com>.
You will have to use a ORDER BY inside nested foreach after the GROUP
statement.

On Sat, Sep 12, 2015 at 8:49 PM, 李运田 <cu...@163.com> wrote:

> when I use group all,I find that the order reverses. is there a setting I
> can use not to Reverse order.
> data:
> (1,a)
> (2,b)
> (all,{(2,b),(1,a)})
> BUT I want to get
> (all,{(1,a),(2,b)})
>
>
> Is there a setting?  thanks
>
>