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

Switch to Threaded View
Pig >> mail # user >> accessing like array


Copy link to this message
-
Re: accessing like array
load the data into a relation and use 'generate' to take only the required
fields from this relation and put into some other relation..then store the
2nd relation into some file.

Regards,
    Mohammad Tariq

On Tue, Nov 6, 2012 at 7:43 PM, jamal sasha <[EMAIL PROTECTED]> wrote:

> Hi,
>   I have data in form
> 1,0.2,0.3
> 1,0.3,0.4
> 2,0.8,0.2
> 2,0.9,0.7
> and so on..
> so id, va1,val2 format..
>
> This id is already sorted based on val 2
> I want to select the 2nd element for each id with val2 (ignoring val1)
> for example in the above dataset what i want to return is
> 1,0.4
> 2,0.7
>
> How to go about this??
> Thanks
>