4. 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. Create a /tmp/input/ directory in HDFS and copy the test.txt file into that directory:

    hdfs dfs -mkdir -p /tmp/input/
    hdfs dfs -put test.txt /tmp/input/
  4. Execute the following command to run the OrderedWordCount application using Tez:

    hadoop jar /usr/hdp/current/tez-client/tez-examples-*.jar orderedwordcount /tmp/input/test.txt /tmp/out
  5. Run the following command to verify the word count:

    hdfs dfs -cat '/tmp/out/*'

    This should return:

    foo 3
    bar 2

loading table of contents...