QnaList > Groups > Pig-User > Jan 2011
faq

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.

asked Jan 7 2011 at 22:00

robert's gravatar image



2 Replies for : Including JARs For UDF In MapReduce Mode
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

answered Jan 7 2011 at 22:10

Dmitriy Ryaboy's gravatar image


Dmitriy,
many thanks, that seemed to stop it complaining about classes not being
found.
Robert.

answered Jan 7 2011 at 22:37

robert's gravatar image


Related discussions

Tagged

Group Pig-user

asked Jan 7 2011 at 22:00

active Jan 7 2011 at 22:37

posts:3

users:2

©2013 QnaList.com . QnaList is part of ZisaTechnologies LLC.