Non-Ambari Cluster Installation Guide
Also available as:
PDF
loading table of contents...

Validating Hive-on-Tez Installation

Use the following procedure to validate your configuration of Hive-on-Tez:

  1. Create a sample test.txt file:

    echo -e "alice miller\t49\t3.15" > student.txt

  2. 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
  3. Open the Hive command-line shell:

    su - $HDFS_USER

  4. 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';

  5. Execute the following query in Hive:

    hive> SELECT COUNT(*) FROM student;

    --------------------------------------------------------------------------------
            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