LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2012, 12:14 AM   #1
chaitanyakumar1988
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Rep: Reputation: Disabled
Smile PIG SERVER or PIG programming


Sorry , i didn't know where to post this but wanted to help people working with PIG for the first time .(As i struggled for a long time to run my first program)
Anyways , please follow the steps to run pig programs via java .

1.write ur program in java as
PigServer pigServer = new PigServer("local"); // here local indicates u run ur prog in local mode, mapreduce indicates u run the prog in cluster mode .
2. register ur queries as
pigServer.registerQuery(<ur queries go here>);
3. run ur queries using
pigServer.store(<whatever u wana store >,<path>);

Now for runnig ur program

javac -cp <locate ur pig jar here> <ur programname>.java

If this doesnt work.. Set the CLASSPATH using export CLASSPATH to point to PIG jar and then run

javac <ur programname>.java

Lastly just run
java <ur programname>.java

and see the output in the path u have specified(local) or in base folder or path specified (mapreduce mode)

Hope people find this useful.
 
Old 02-23-2012, 05:17 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Any pig that winds up in a jar around my place is gonna be named: bacon.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Guinea pig laptop Camryn Linux - Laptop and Netbook 4 06-19-2007 05:15 AM
LXer: "A Pig(Snort), A Moon (Lua) and one very happy developer (Bill)" LXer Syndicated Linux News 0 05-10-2007 03:31 AM
A Question About Printing or How can I sew wings on this Pig? steve_f60 Linux - General 1 06-11-2005 04:45 AM
SCO suit against Linux user - Who's the Guinea Pig??? JaseP General 13 03-16-2004 09:33 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration