


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



data:text/html;charset=utf 8,%3Ch1%20style%3D%22box sizing%3A%20border box%3B%20margin top%3A%200px%3B%20font weight%3A%20700%3B%2⌠1/
user@ubuntu:~$ cd /usr/lib/ user@ubuntu:~$ sudo mkdir hive user@ubuntu:~$ cd Downloads user@ubuntu:~$ sudo mv apacheâhiveâ0.13.0âbin /usr/lib/hive
user@ubuntu:~$ cd user@ubuntu:~$ sudo gedit ~/.bashrc
export HIVE_HOME="/usr/lib/hive/apacheâhiveâ0.13.0âbin" PATH=$PATH:$HIVE_HOME/bin
data:text/html;charset=utf 8,%3Ch1%20style%3D%22box sizing%3A%20border box%3B%20margin top%3A%200px%3B%20font weight%3A%20700%3B%2⌠2/
export PATH
Setting HADOOP_PATH in HIVE config.sh
user@ubuntu:~$ cd /usr/lib/hive/apacheâhiveâ0.13.0âbin/bin user@ubuntu:~$ sudo gedit hiveâconfig.sh
HIVE_CONF_DIR="${HIVE_CONF_DIR:â$HIVE_HOME/conf" export HIVE_CONF_DIR=$HIVE_CONF_DIR export HIVE_AUX_JARS_PATH=$HIVE_AUX_JARS_PATH
export HADOOP_HOME=/usr/local/hadoop (write the path where hadoop file is there)
Create Hive directories within HDFS
user@ubuntu:~$ hadoop fs âmkdir /usr/hive/warehouse
Setting READ/WRITE permission for table
user@ubuntu:~$ hadoop fs âchmod g+w /usr/hive/warehouse
HIVE launch
user@ubuntu:~$ hive
data:text/html;charset=utf 8,%3Ch1%20style%3D%22box sizing%3A%20border box%3B%20margin top%3A%200px%3B%20font weight%3A%20700%3B%2⌠4/
com.mysql.jdbc.Driver Driver class name for a JDBC metastore
hive.metastore.warehouse.dir /usr/hive/warehouse location of default database for the warehouse
Writing a Script
user@ubuntu:~$ sudo gedit sample.sql
create database sample; use sample; create table product(product int, productname string, price float)[row format delimited fields terminated by describe product;
select * from product;
user@ubuntu:~$ sudo gedit input_to_product.txt user@ubuntu:~$ cd /usr/lib/hive/apacheâhiveâ0.13.0âbin/ $ bin/hive âf /home/hduser/sample.sql