You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Ruslan Al-Fakikh <me...@gmail.com> on 2013/11/14 06:11:49 UTC

Re: SQL- WHILE in Pig

There is no such control logic in Pig.

Maybe the FOREACH statement can help, but it's not a loop, but rather a
processing operator.
Also we may want to use Pig Embedding to launch pig from other languages.

Thanks


On Wed, Oct 30, 2013 at 11:45 AM, Murphy Ric <mu...@gmail.com>wrote:

> I have a code in SQL to convert to Pig. I request for your help in
> converting this code.
>
> WHILE @Dt1 <= @Dt2
> BEGIN
> INSERT INTO ( , , , )
>                 SELECT , , , ,
>                 WHERE X > Y
> SELECT @Dt1 = SELECT DATEADD(MM,1,@Dt1))
> END
>

Re: SQL- WHILE in Pig

Posted by TianYi Zhu <ti...@facilitatedigital.com>.
You could use while in your UDF.


On 14 November 2013 16:11, Ruslan Al-Fakikh <me...@gmail.com> wrote:

> There is no such control logic in Pig.
>
> Maybe the FOREACH statement can help, but it's not a loop, but rather a
> processing operator.
> Also we may want to use Pig Embedding to launch pig from other languages.
>
> Thanks
>
>
> On Wed, Oct 30, 2013 at 11:45 AM, Murphy Ric <murphyrichards@gmail.com
> >wrote:
>
> > I have a code in SQL to convert to Pig. I request for your help in
> > converting this code.
> >
> > WHILE @Dt1 <= @Dt2
> > BEGIN
> > INSERT INTO ( , , , )
> >                 SELECT , , , ,
> >                 WHERE X > Y
> > SELECT @Dt1 = SELECT DATEADD(MM,1,@Dt1))
> > END
> >
>