You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Todd Lee <ro...@gmail.com> on 2011/01/17 23:14:26 UTC

Is GROUP order-preserving?

Hi,

Is GROUP order-preserving? It is not mentioned in the Pig Latin doc while it
does mention that UNION is not.

Thanks,
T

Re: Is GROUP order-preserving?

Posted by Dmitriy Ryaboy <dv...@gmail.com>.
It is not. UNION is in relational databases (it distincts, too, which Pig
does not), which is why it's specifically called out.
Since in SQL you can't reach inside grouped collections, their order is
arbitrary and depends on the operator implementation, so as there is no
existing expectation with regards to order, it did not get called out.
You can order tuples in bags returned as a result of grouping by using an
ORDER operator inside a foreach loop, of course.

D

On Mon, Jan 17, 2011 at 2:14 PM, Todd Lee <ro...@gmail.com> wrote:

> Hi,
>
> Is GROUP order-preserving? It is not mentioned in the Pig Latin doc while
> it
> does mention that UNION is not.
>
> Thanks,
> T
>

RE: Is GROUP order-preserving?

Posted by Olga Natkovich <ol...@yahoo-inc.com>.
None of pig operations other than ORDER BY (and ORDER BY followed by LIMIT) make any order guarantees.

Olga

-----Original Message-----
From: Todd Lee [mailto:ronnietoddlee@gmail.com] 
Sent: Monday, January 17, 2011 2:14 PM
To: user@pig.apache.org
Subject: Is GROUP order-preserving?

Hi,

Is GROUP order-preserving? It is not mentioned in the Pig Latin doc while it
does mention that UNION is not.

Thanks,
T