3. Validate the Installation

Use the following steps to validate your installation:

  1. On the host machine where Pig is installed execute the following commands:

    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:

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

    export JAVA_HOME=/usr/java/default
     pig -l /tmp/pig.log /tmp/id.pig

loading table of contents...