/    /  Hive – Installation

Hive – Installation

Hive stores it tables schemas i.e. its metadata in Metastore. Metastore is a type of database which only stores hive metadata. We will see about it in detail in next slides. Generally, to install hive before we need to install the latest version of Hadoop and on top of it we will install hive.

Download a latest release of hive, and unpack the tarball in a suitable place in your workstation.

% tar xzf apache-hive-x.y.z-bin.tar.gz

Now to run the Hive shell, we can do it in 2 ways.

  1. Put hive in your path,
% export HIVE_HOME=~/sw/apache-hive-x.y.z-bin

% export PATH=$PATH:$HIVE_HOME/bin

%hive

2. Go to hive folder and type

%bin/hive

Now what is hive shell, it is the primary shell which we use to interact with hive. HiveQL is hive query language which is mostly influenced by Mysql. When we start hive first, we can check whether it is working correctly or not by using this command – there should be none.

hive> SHOW TABLES;

OK

Time taken: 0.473 seconds

HiveQL is case-insensitive, the tab key will autocomplete hive keywords and functions. Generally, when we execute above command for the fresh install it will take little more time to execute as it creates metastore database for us.