Hadoop Hive
Hadoop Hive
\ (root)
|--home
| |
| |--main
| | | ...
| | | ...
| |
| |--hadoop
| | | Downloads
| | | hadoop
| | | .bashrc
| | | ...
#Hive
export HIVE_HOME=/home/hadoop/hive
export PATH=$PATH:$HIVE_HOME/bin
# ====================================
hadoop@vm:~$ cd $HIVE_HOME/conf
hadoop@vm:~/hive/conf$ cp hive-default.xml.template hive-site.xml
hadoop@vm:~/hive/conf$ nano hive-site.xml
Remove the  in the line 3215 use CTRL+SHIT+- to move cursor to a line.
Make sure the guava is same for the hadoop and hive
<property>
<name>system:java.io.tmpdir</name>
<value>/tmp/hive/java</value>
</property>
<property>
<name>system:user.name</name>
<value>${user.name}</value>
</property>
You can change the location of warehouse in hadoop by editing the values in the
below property in hive-site.xml
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description>location of default database for the warehouse</description>
</property>
You can also change the meta store to mysql by replacing the DERBY with
required service
<property>
<name>hive.metastore.db.type</name>
<value>DERBY</value>
<description>
Expects one of [derby, oracle, mysql, mssql, postgres].
Type of database used by the metastore. Information schema &
JDBCStorageHandler depend on >
</description>
</property>
3. Code in Hive