Professional Documents
Culture Documents
Hive PDF
Hive PDF
X cluster
https://archive.apache.org/dist/hive/hive-0.12.0/hive-0.12.0.tar.gz
2. Unzip hive-0.12.0
mca@mca-VirtualBox:~$ cd hive-0.12.0
mca@mca-VirtualBox:~/hive-0.12.0$
mca@mca-VirtualBox:~$ cd hive-0.12.0
mca@mca-VirtualBox:~/hive-0.12.0$ bin/hive
Logging initialized using configuration in jar:file:/home/mca/hive-0.12.0/lib/hive-
common-0.12.0.jar!/hive-log4j.properties
Hive>
The following query adds a column named dept to the employee table
Hive> ALTER TABLE employee1 ADD COLUMNS (
> dept STRING COMMENT 'Department name');
OK
Time taken: 0.114 seconds
The following query loads the given text into the table
The following query is executed to retrieve the employee details whose employee
id=1201.
Hive> select * from employee1 where eid=1201;
1201 Raja Asst-Manager 18000 HRM
The following query is executed to retrieve the employee details whose salary is
more than or equal to Rs 10000.
9. Select and Where Clause
Hive> SELECT * FROM employee1 WHERE Salary>=10000;
1201 Raja Asst-Manager 18000 HRM
1202 Raul Asst-Manager 18500 TP
1203 Kiran Op-Admin 12500 ADMIN
1204 Robin Programmer 12000 ADMIN