Use the following procedure to run an example Tez application, such as OrderedWordCount, and validate your Tez installation.
Create a sample
test.txt
file:foo bar foo bar foo
Log in as the
$HDFS_USER
. The$HDFS_USER
is the user that owns the HDFS service. For example,hdfs
:su $HDFS_USER
Upload the
test.txt
file into HDFS:hadoop fs -put test.txt /tmp/test.txt
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
Run the following command to verify the word count:
hadoop fs -cat '/tmp/out/*'
This should return:
foo 3 bar 2