Category Archives: Big Data

Hive Services

Hive Services There are total six Hive services currently run in Hadoop ecosystem. Hive CLI (Command Line Interface) Service: This service is used to manage tables, run hive queries. It is the default service in Hive. It is the most common way of interacting with the hive. Example: Go to command prompt and type: bin/hive… Read More »

Hive Tutorials

Hive Tutorials I highly recommend everyone to buy and read the book to get clear theoretical knowledge about the Hive. You can find book below. This short tutorial will explain you how to create table in Hive, how to import data into hive table. For more advanced hive create table commands please refer my further… Read More »

Hive namespaces (Variables and Properties)

Hive namespaces (Variables and Properties) There are total four namespaces available in Hive, we will go through each one. hivevar This is useful in defining our own custom variables for example Hive> set hivevar:toodey=hello; Hive> set toodey; Now we can use this in any Hive query statement as we have seen in my previous tutorial… Read More »

Datatypes in apache hive

Datatypes in apache hive What are the most common datatypes we used in apache hive, in this tutorial you will find the list of datatypes that are most common in use! Hive supports Primitive Data Types TINYINT It’s a 1 byte integer. SMALLINT It’s a 2 byte integer INT It’s a 4 byte integer BIGINT… Read More »

Create table in Hive using octal code

Create table in Hive using octal code Reference Example is take from Programming in Hive book Let’s create a table in hive CREATE TABLE employee ( name  STRING, salary FLOAT,  subordinates ARRAY<STRING> deductions MAP<STRING, FLOAT> address STRUCT<street:STRING, city:STRING, state:STRING,zip:INT>) ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘\001’ COLLECTION ITEMS TERMINATED BY ‘\002’ MAP KEYS TERMINATED BY ‘\003’ LINES… Read More »

How to add multiple partition in hive

How to add multiple partition in hive The simple example to add partition would be ALTER TABLE employee ADD IF NOT EXISTS PARTITION (countryName= ‘US’) LOCATION ‘/employee/US’ PARTITION (countryName= ‘EU’) LOCATION ‘/employee/EU’ How to drop a partition in hive ALTER TABLE employee DROP IF EXISTS PARTITION(countryName= ‘US’) How to rename a column in hive ALTER… Read More »