3. Validate the Installation

Use these steps to validate your installation.

 3.1. Smoke Test Pig

  1. Use a terminal window on a machine where Pig is installed and login as $HDFS_USER :

    /usr/lib/hadoop/bin/hadoop dfs -copyFromLocal /etc/passwd passwd
  2. Create the pig script file /tmp/id.pig with the following contents:

    echo "A = load 'passwd' using PigStorage(':'); " > /tmp/id.pig
    echo "B = foreach A generate \$0 as id; store B into '/tmp/id.out'; " >> /tmp/id.pig
    
  3. Execute the Pig script:

    pig -l /tmp/pig.log /tmp/id.pig

loading table of contents...