a platform used to develop SQL
type scripts to do MapReduce operations
All the data types in Hive are classified into four types-
Syntax: ARRAY<DATA_TYPE>
Syntax: MAP<primitive_type, data_type>
Syntax: STRUCT<col_name: data_type[ COMMENT col_comment,.....]>
hive>create database [if not exists] userdb;
hive>create schema usedb;
hive> show databses;
hive> drop database [if exists] userdb;
hive> drop database [if exists] userdb cascade;
hive> drop schema userdb;
hive> create table if not exists employee( eid int, name string, salary decinal, destionation string)
>comment 'employee details'
>row format delimited
>fields terminated by '\t'
>lines terminated by '\n'
>stored as text file
Syntax: hive>alter table employee add partition(year='2013') location '/2012/part2012';
Syntax: hive>alter table employee drop [if exists] partition (year='2013');
Join, Left Outer Join, Right Outer Join, Full Outer Join
Syntax: hive> SELECT c.ID, c.NAME, c.AGE, o. AMOUNT FROM CUSTOMERS c JOIN ORDERS o ON (c.ID= o. CUSTOMER_ID)