Configure Apache Pig
Before you can upgrade Apache Pig, you must have first upgraded your HDP components to the latest version (in this case, 2.4.3). This section assumes that you have already upgraded your components for HDP 2.4.3. If you have not already completed these steps, return to Getting Ready to Upgrade and Upgrade 2.1 Components for instructions on how to upgrade your HDP components to 2.4.3.
Replace your configuration after upgrading. Copy
/etc/pig/conf
from the template to the conf directory in pig hosts.To validate the Pig upgrade, complete the following steps:
On the host machine where Pig is installed, run the following commands:
su - $HDFS_USER -c "/usr/hdp/current/hadoop-client/bin/hadoop fs -copyFromLocal /etc/passwd passwd"
Create a Pig script file named
/tmp/id.pig
that contains the following Pig Latin commands:A = load 'passwd' using PigStorage(':');B = foreach A generate $0 as id; store B into '/tmp/id.out';
Run the Pig script:
su - $HDFS_USER pig -l /tmp/pig.log /tmp/id.pig