You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by je...@orange-ftgroup.com on 2008/11/13 02:04:22 UTC
ORDER BY using natural order
Hi,
How do I hint pig so it sorts using natural order instead of lexical
order?
(using pig 2.0)
Thanks.
RE: ORDER BY using natural order
Posted by je...@orange-ftgroup.com.
Thanks that's what I was looking for.
-----Original Message-----
From: Olga Natkovich [mailto:olgan@yahoo-inc.com]
Sent: Wednesday, November 12, 2008 5:24 PM
To: pig-user@hadoop.apache.org; pig-user@incubator.apache.org
Subject: RE: ORDER BY using natural order
Do you mean in numeric order for numeric fields?
You need to declare field type in the load:
A = load 'data' as (i: int);
B = order A by i;
This will use numeric order.
Olga
> -----Original Message-----
> From: jeremy.huylebroeck@orange-ftgroup.com
> [mailto:jeremy.huylebroeck@orange-ftgroup.com]
> Sent: Wednesday, November 12, 2008 5:04 PM
> To: pig-user@incubator.apache.org
> Subject: ORDER BY using natural order
>
>
> Hi,
> How do I hint pig so it sorts using natural order instead of lexical
> order?
> (using pig 2.0)
>
> Thanks.
>
>
RE: ORDER BY using natural order
Posted by Olga Natkovich <ol...@yahoo-inc.com>.
Do you mean in numeric order for numeric fields?
You need to declare field type in the load:
A = load 'data' as (i: int);
B = order A by i;
This will use numeric order.
Olga
> -----Original Message-----
> From: jeremy.huylebroeck@orange-ftgroup.com
> [mailto:jeremy.huylebroeck@orange-ftgroup.com]
> Sent: Wednesday, November 12, 2008 5:04 PM
> To: pig-user@incubator.apache.org
> Subject: ORDER BY using natural order
>
>
> Hi,
> How do I hint pig so it sorts using natural order instead of
> lexical order?
> (using pig 2.0)
>
> Thanks.
>
>