Validating Hive-on-Tez Installation
Use the following procedure to validate your configuration of Hive-on-Tez:
Create a sample test.txt file:
echo -e "alice miller\t49\t3.15" > student.txt
Upload the new data file to HDFS:
su - $HDFS_USER hadoop fs -mkdir -p /user/test/student hadoop fs -copyFromLocal student.txt /user/test/student hadoop fs -chown hive:hdfs /user/test/student/student.txt hadoop fs -chmod 775 /user/test/student/student.txt
Open the Hive command-line shell:
su - $HDFS_USER
Create a table named "student" in Hive:
hive> CREATE EXTERNAL TABLE student(name string, age int, gpa double) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'STORED AS TEXTFILE LOCATION '/user/test/student';
Execute the following query in Hive:
hive> SELECT COUNT(*) FROM student;
If Hive-on-Tez is configured properly, this query should return successful results similar to the following:
-------------------------------------------------------------------------------- VERTICES STATUS TOTAL COMPLETED RUNNING PENDING FAILED KILLED -------------------------------------------------------------------------------- Map 1 .......... SUCCEEDED 117 117 0 0 0 0 Reducer 2 ...... SUCCEEDED 1 1 0 0 0 0 -------------------------------------------------------------------------------- VERTICES: 02/02 [==========================>>] 100% ELAPSED TIME: 445.02 s -------------------------------------------------------------------------------- Status: DAG finished successfully in 445.02 seconds Time taken: 909.882 seconds