- Download the desired pig distribution from any one of the Apache Mirrors. It is best if you choose the latest version of Pig. Also, download the file whose name is like pig-0.12.1.tar.gz, where "0.12.1"is the version number.
- Extract Pig to a desired directory.
- Simple way is to copy the tar.gz to the root directory where you want your installation to reside.
- Now, execute the following code in Linux bash at the directory
tar -xzf pig-0.12.1.tar.gz
- You will have the installation ready.
- Editing Path
- To access the pig installation easily and run your scripts from anywhere, make sure to add the pig's bin in your path.
- To do this, open the file /home/user/.bashrc in your favorite editor and copy the following line at the end of the file.
export PATH=/<my path to pig>/pig-n.n.n/bin:$PATH
- After doing all this, your Pig installation is ready for further configuration.
Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected
Now, that's a problem. Don't worry, solving it is unbelievably simple. This is what you will have to do:
- cd to your pig installation directory. Yes, inside the Pig directory.
- And run this code:
ant clean jar-withouthadoop -Dhadoopversion=23
After that, try running your Pig script again. You will find that everything is alright now.
Any problems working this around or have any suggestions? Just comment it below :)