3. Validate the Tez Installation

Use the following procedure to run an example Tez application, such as OrderedWordCount, and validate your Tez installation.

  1. Create a sample test.txt file:

    foo
    bar
    foo
    bar
    foo
  2. Log in as the $HDFS_USER. The $HDFS_USER is the user that owns the HDFS service. For example, hdfs:

    su $HDFS_USER
  3. Upload the test.txt file into HDFS:

    hadoop fs -put test.txt /tmp/test.txt
  4. Execute the following command to run the OrderedWordCount application using Tez:

    hadoop jar /usr/lib/tez/tez-mapreduce-examples-*.jar orderedwordcount /tmp/test.txt /tmp/out

  5. Run the following command to verify the word count:

    hadoop fs -cat '/tmp/out/*'

    This should return:

    foo 3
    bar 2


loading table of contents...