You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Raj hadoop <ra...@gmail.com> on 2013/09/15 19:37:44 UTC

self join in pig

Hi,

I need to subtract row2 value from row1.  how to get it in Pig?

Thanks
Rajesh

Re: self join in pig

Posted by Ruslan Al-Fakikh <me...@gmail.com>.
Also keep in mind that a Pig relation is not aware of the order of records
unless right after the ORDER statement. I guess that you need to use a row
with a preceding row,corrent? Probably you'll need the RANK:
http://pig.apache.org/docs/r0.11.1/basic.html#rank
to use as a key for the join.

Best Regards,
Ruslan Al-Fakikh
https://www.odesk.com/users/~015b7b5f617eb89923




On Sun, Sep 15, 2013 at 10:10 PM, Shahab Yunus <sh...@gmail.com>wrote:

> You need to load your data twice and then use it as any other join.
> Self-join is just like any other join to Pig.
>
> Regards,
> Shahab
>
>
> On Sun, Sep 15, 2013 at 1:37 PM, Raj hadoop <ra...@gmail.com> wrote:
>
> > Hi,
> >
> > I need to subtract row2 value from row1.  how to get it in Pig?
> >
> > Thanks
> > Rajesh
> >
>

Re: self join in pig

Posted by Shahab Yunus <sh...@gmail.com>.
You need to load your data twice and then use it as any other join.
Self-join is just like any other join to Pig.

Regards,
Shahab


On Sun, Sep 15, 2013 at 1:37 PM, Raj hadoop <ra...@gmail.com> wrote:

> Hi,
>
> I need to subtract row2 value from row1.  how to get it in Pig?
>
> Thanks
> Rajesh
>