'register' is your friend here http://hadoop.apache.org/pig/docs/r0.5.0/piglatin_reference.html#REGISTER Ashutosh answered Feb 5 2010 at 18:46 |
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 |
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 |
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, 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 |
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 |
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 |
Group Pig-user
asked Feb 5 2010 at 07:25
active Feb 5 2010 at 22:10
posts:8
users:5