You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by robert <ra...@googlemail.com> on 2011/01/07 23:00:21 UTC
Including JARs for UDF in MapReduce mode
Hey Guys,
I am running into a bit of trouble, and I know its something that must be
commonly done. I have created a loader function which uses external JARs,
which is fine when ran in local mode; the Pig job is also scripted in
embedded mode (so included in native java). The JARs aren't required by my
Pig script directly, but required by the UDF that the Pig script uses, how
do I distribute the JARs in mapreduce mode and how do I setup my native java
code to access it ?
Many Thanks,
Robert.
Re: Including JARs for UDF in MapReduce mode
Posted by robert <ra...@googlemail.com>.
Dmitriy,
many thanks, that seemed to stop it complaining about classes not being
found.
Robert.
On Fri, Jan 7, 2011 at 10:10 PM, Dmitriy Ryaboy <dv...@gmail.com> wrote:
> You just need to:
> 1) make sure they are on the classpath when you call pig (you can add them
> to PIG_CLASSPATH)
> 2) add "register /path/to/myrequired.jar" at the top of your script for
> every required jar.
>
> -D
>
> On Fri, Jan 7, 2011 at 2:00 PM, robert <ra...@googlemail.com> wrote:
>
> > Hey Guys,
> >
> > I am running into a bit of trouble, and I know its something that must be
> > commonly done. I have created a loader function which uses external JARs,
> > which is fine when ran in local mode; the Pig job is also scripted in
> > embedded mode (so included in native java). The JARs aren't required by
> my
> > Pig script directly, but required by the UDF that the Pig script uses,
> how
> > do I distribute the JARs in mapreduce mode and how do I setup my native
> > java
> > code to access it ?
> >
> > Many Thanks,
> >
> > Robert.
> >
>
Re: Including JARs for UDF in MapReduce mode
Posted by Dmitriy Ryaboy <dv...@gmail.com>.
You just need to:
1) make sure they are on the classpath when you call pig (you can add them
to PIG_CLASSPATH)
2) add "register /path/to/myrequired.jar" at the top of your script for
every required jar.
-D
On Fri, Jan 7, 2011 at 2:00 PM, robert <ra...@googlemail.com> wrote:
> Hey Guys,
>
> I am running into a bit of trouble, and I know its something that must be
> commonly done. I have created a loader function which uses external JARs,
> which is fine when ran in local mode; the Pig job is also scripted in
> embedded mode (so included in native java). The JARs aren't required by my
> Pig script directly, but required by the UDF that the Pig script uses, how
> do I distribute the JARs in mapreduce mode and how do I setup my native
> java
> code to access it ?
>
> Many Thanks,
>
> Robert.
>