QnaList > Groups > Pig-User > Feb 2010
faq

Automatically REGISTER Jars

Hi All,
We have a use-case where we want to automatically register certain jars for
command-line users. I tried using ­jar, but this switch seems to do
absolutely nothing.
How do we go about auto-registering jars using pig? Any help is much
appreciated.
Thanks in advance!
Chris

asked Feb 5 2010 at 07:25

Chris Riccomini's gravatar image



7 Replies for : Automatically REGISTER Jars
What I want to do is register the jar WITHOUT register. That is, when I
issue my pig commandline call to start pig, it will register it at that
point rather than in my pig script.
This will save our users from all having to register 3 or 4 jars that they
always will need to use pig effectively on our Hadoop cluster.
Thanks,
Chris

answered Feb 5 2010 at 18:58

Chris Riccomini's gravatar image


I've never tried this but putting te jars on your pig classpath should  
save you from having to register as I believe pig looks here for jars  
by default
Sent from my iPhone

answered Feb 5 2010 at 19:36

Zaki Rahaman's gravatar image


Putting the jars on your classpath works as long as the classes you  
need are directly referenced in your script.  So:
B = foreach A generate com.mycompany.myudf($0);
If myudf is in a jar somewhere in your classpath then it will be  
picked up.  If myudf depends on the class myudfsupport which is also  
in a jar on your classpath, myudfsupport will not be picked up.  It  
must be explicitly registered.
Alan.

answered Feb 5 2010 at 19:46

Alan Gates's gravatar image


Alan,
Thanks for the clarification. This thread raises an important issue. I thin=
k
it would be worthwhile to be able to set up some mechanism for setting up a
"script environment." Maybe an option to be able to register jars on the
command line or maybe some way of including/requiring dummy scripts (with
register commands) as part of other scripts. Thoughts?

answered Feb 5 2010 at 20:09

zaki rahaman's gravatar image


I would love to be able to register jars when starting the commandline. This
is exactly what I need. I think we just need to create a -r switch in Main
that calls pigContext.addJar(). Is this right?
Thanks,
Chris

answered Feb 5 2010 at 21:29

Chris Riccomini's gravatar image


Being able to add jars from the command line seems like a useful thing  
to be able to do.  I've created https://issues.apache.org/jira/browse/PIG-1226 
  to track this.
Alan.

answered Feb 5 2010 at 22:10

Alan Gates's gravatar image


Related discussions

Tagged

Group Pig-user

asked Feb 5 2010 at 07:25

active Feb 5 2010 at 22:10

posts:8

users:5

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