{"id":335,"date":"2019-07-28T09:01:23","date_gmt":"2019-07-28T03:31:23","guid":{"rendered":"https:\/\/techieshouts.com\/?p=335"},"modified":"2022-08-09T19:07:15","modified_gmt":"2022-08-09T13:37:15","slug":"pig-installation-steps","status":"publish","type":"post","link":"https:\/\/techieshouts.com\/home\/pig-installation-steps\/","title":{"rendered":"PIG Installation steps"},"content":{"rendered":"\n<div class=\"wp-block-media-text alignwide\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" width=\"200\" height=\"140\" src=\"https:\/\/techieshouts.com\/wp-content\/uploads\/2019\/07\/PigInstallation.jpg\" alt=\"\" class=\"wp-image-337\"\/><\/figure><div class=\"wp-block-media-text__content\">\n<p>In this previous article, we saw how to install Apache Hive in the Ubuntu machine. Both of these articles are written with an assumption that you have already installed the Hadoop framework in the machine. If not, please visit this post and install the Hadoop framework first.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-ub-divider\"><div class=\"ub_divider\" style=\"border-top:2px solid #0693e3;margin-top:20px;margin-bottom:20px\"><\/div><\/div>\n\n\n\n<p>Pig is another component of the Hadoop ecosystem for processing data of large volumes. Pig uses the PIG LATIN script for data processing. Let\u2019s get the PIG installation started.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<ul><li>First, we need to download the PIG tarball. You can download that <a href=\"http:\/\/www.apache.org\/dyn\/closer.cgi\/pig\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/li><li>After downloading the tarball, we need to extract it in the home directory.<\/li><li> Now that we have PIG in our home directory we need to set the paths in .bashrc file. Add the below lines to the .bashrc file<\/li><\/ul>\n\n\n\n<pre data-mode=\"scss\" data-theme=\"solarized_light\" data-fontsize=\"14\" data-lines=\"Infinity\" class=\"wp-block-simple-code-block-ace\">export PIG_HOME=\/home\/user\/pig\nexport PATH=$PIG_HOME\/bin:$PATH<\/pre>\n\n\n\n<ul><li> Refresh the bashrc file with the command \u201c<strong>source ~\/.bashrc<\/strong>\u201c. <\/li><li> To check if the paths are set correctly use \u201cecho $PIG_HOME\u201d command to see it in the terminal. <\/li><\/ul>\n\n\n\n<p>We have now installed PIG in our machine. There are two ways to work in PIG. Local mode and MapReduce mode. In local mode, you don\u2019t have to run the daemons but in MR mode you have to. Use the below commands to start PIG in the respective modes<\/p>\n\n\n\n<p><strong>pig -x local<\/strong><\/p>\n\n\n\n<p><strong>pig -x mapreduce<\/strong><\/p>\n\n\n\n<p>During the processing of data in PIG\u2019s grunt shell, you may see a lot of information getting displayed in the shell interface. Those are the logs related to that operation in PIG. To <strong>suppress those info level logs<\/strong> and display only the errors please perform the below steps.<\/p>\n\n\n\n<ul><li>First, create the log4j.properties file under the conf directory of PIG installed path. This can be done by copying the log4j.properties.template file and renaming it to log4j.properties.<\/li><li>cp $PIG_HOME\/conf\/log4j.properties.template $PIG_HOME\/conf\/log4j.properties<\/li><li>Next, we have to overwrite the properties in the file that points to info with an error. <\/li><\/ul>\n\n\n\n<p><strong>Replace<\/strong><br>log4j.logger.org.apache.pig=info, A ===&gt; log4j.logger.org.apache.pig=error, A <\/p>\n\n\n\n<p><strong>Add<\/strong><br>log4j.logger.org.apache.hadoop = error, A <\/p>\n\n\n\n<p>That&#8217;s it. You have successfully installed PIG. Enjoy processing using PIG.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this previous article, we saw how to install Apache Hive in the Ubuntu machine. Both of these articles are written with an assumption that you have already installed the Hadoop framework in the machine. If not, please visit this post and install the Hadoop framework first. Pig is another component of the Hadoop ecosystem\u2026 <span class=\"read-more\"><a href=\"https:\/\/techieshouts.com\/home\/pig-installation-steps\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":337,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[11,125],"tags":[25,22,23,24],"_links":{"self":[{"href":"https:\/\/techieshouts.com\/home\/wp-json\/wp\/v2\/posts\/335"}],"collection":[{"href":"https:\/\/techieshouts.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techieshouts.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techieshouts.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techieshouts.com\/home\/wp-json\/wp\/v2\/comments?post=335"}],"version-history":[{"count":5,"href":"https:\/\/techieshouts.com\/home\/wp-json\/wp\/v2\/posts\/335\/revisions"}],"predecessor-version":[{"id":350,"href":"https:\/\/techieshouts.com\/home\/wp-json\/wp\/v2\/posts\/335\/revisions\/350"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techieshouts.com\/home\/wp-json\/wp\/v2\/media\/337"}],"wp:attachment":[{"href":"https:\/\/techieshouts.com\/home\/wp-json\/wp\/v2\/media?parent=335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techieshouts.com\/home\/wp-json\/wp\/v2\/categories?post=335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techieshouts.com\/home\/wp-json\/wp\/v2\/tags?post=335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}