You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Fernando Doglio <fe...@moove-it.com> on 2012/04/19 23:21:59 UTC

Can I define a procedure or function on pig?

Been looking around for this, but couldn't find an answer.

Is there any way for me to define a function or procedure inside a pig
script so I don't have to copy&paste my piglatin code several times inside
the same script?

Thanks!
Fernando

Re: Can I define a procedure or function on pig?

Posted by Fernando Doglio <fe...@moove-it.com>.
Awesome! Thanks! I'll look into that :)

On Thu, Apr 19, 2012 at 6:27 PM, John Whitfield <
john.whitfield@intentmedia.com> wrote:

> Pig supports Macros:
> http://pig.apache.org/docs/r0.9.2/cont.html#define-macros
>
> On Thu, Apr 19, 2012 at 5:21 PM, Fernando Doglio <
> fernando.doglio@moove-it.com> wrote:
>
> > Been looking around for this, but couldn't find an answer.
> >
> > Is there any way for me to define a function or procedure inside a pig
> > script so I don't have to copy&paste my piglatin code several times
> inside
> > the same script?
> >
> > Thanks!
> > Fernando
> >
>

Re: Can I define a procedure or function on pig?

Posted by John Whitfield <jo...@intentmedia.com>.
Pig supports Macros:
http://pig.apache.org/docs/r0.9.2/cont.html#define-macros

On Thu, Apr 19, 2012 at 5:21 PM, Fernando Doglio <
fernando.doglio@moove-it.com> wrote:

> Been looking around for this, but couldn't find an answer.
>
> Is there any way for me to define a function or procedure inside a pig
> script so I don't have to copy&paste my piglatin code several times inside
> the same script?
>
> Thanks!
> Fernando
>