Installing Hive
Installing Hive is simple and only requires having Java 1.6 and Ant installed on your machine.
Hive is available via SVN at http://svn.apache.org/repos/asf/hive/trunk. You can download it by running the following command.
$ svn co http://svn.apache.org/repos/asf/hive/trunk hive
To build hive, execute the following command on the base directory:
$ ant package
It will create the subdirectory build/dist with the following contents:
- README.txt: readme file.
- bin/: directory containing all the shell scripts
- lib/: directory containing all required jar files)
- conf/: directory with configuration files
- examples/: directory with sample input and query files
Subdirectory build/dist should contain all the files necessary to run hive. You can run it from there or copy it to a different location, if you prefer.
In order to run Hive, you must have hadoop in your path or have defined the environment variable HADOOP_HOME with the hadoop installation directory.
Moreover, we strongly advise users to create the HDFS directories /tmp and /user/hive/warehouse
(aka hive.metastore.warehouse.dir) and set them chmod g+w before tables are created in Hive.
To use hive command line interface (cli) go to the hive home directory (the one with the contents of build/dist) and execute the following command:
$ bin/hive
Metadata is stored in an embedded Derby database whose disk storage location is determined by the hive configuration variable named javax.jdo.option.ConnectionURL. By default (see conf/hive-default.xml), this location is ./metastore_db
Using Derby in embedded mode allows at most one user at a time. To configure Derby to run in server mode, look at HiveDerbyServerMode.
a