Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Sorting a tuple's content


Copy link to this message
-
Re: Sorting a tuple's content
Yes, that _will_ guarantee that the ordering is what you've specified.

On Fri, Jul 23, 2010 at 11:33 AM, Jai Krishna <[EMAIL PROTECTED]> wrote:
> So a question on a related note, is there any correlation between the way the tuple was constructed and the order of items in a Tuple?
>
> E.g.
>
> FOREACH foo GENERATE $1, $2, $3, $4
>
> Would that guarantee (or not) that the ordering inside the tuple would also be ($1, $2, $3, $4)
>
> -RJK
>
> P.S: Im new to Pig so Im probably missing many things.
>
> On 7/22/10 11:56 PM, "Renato Marroquín Mogrovejo" <[EMAIL PROTECTED]> wrote:
>
> Thanks there Dmitriy. I will write my own then.
>
> Renato M.
>
> 2010/7/21 Dmitriy Ryaboy <[EMAIL PROTECTED]>
>
>> that has to be a UDF, there is nothing built in for this.
>>
>> On Wed, Jul 21, 2010 at 6:33 PM, Renato Marroquín Mogrovejo <
>> [EMAIL PROTECTED]> wrote:
>>
>> > Hey everybody, Does any body know how I can sort a tuple's content?
>> > For example, I have (770001,880001,990001,770001) and I would like to
>> > obtain
>> > (770001,770001,880001,990001). I tried doing a group by the first field
>> but
>> > the thing is that I still get the whole tuple as a resultant bag.
>> > Thanks in advanced.
>> >
>> > Renato M.
>> >
>>
>
>

--
Harsh J
www.harshj.com