Hive
What is Hive? Architecture & Modes
In this tutorial, you will learn- What is Hive? Hive Architecture Different modes of Hive What is...
So the solution here is
Step 1) In this step, we are going to perform two tasks
Install MySQL as shown in the screenshot
Step 2) Installing MySQL Java Connector. This is for java dependencies and connection purpose
Step 3) Creating soft link for connector in Hive lib directory. This is for soft link between Java and MySql.
Step 4) Configuring MySql storage in Hive
Step 5) Creating username and password for MySql, granting privileges.
We have to execute the commands as shown below,
mysql> CREATE USER 'hiveuser'@'%' IDENTIFIED BY 'hivepassword'; mysql> GRANT all on *.* to 'hiveuser'@localhost identified by 'hivepassword'; mysql> flush privileges;
Step 6) Configuring hive-site.xml
From the above screenshot, we observe the following. Here we are defining 4 properties that could be necessary to establish MYSQL as Meta store in Hive
These are as follows:
Once the properties placed in hive –site.xml we have to manually save (Ctrl+S) and close the file. After closing this file, we have to create Hive table and check the table details in MySQL storage.
Place this code in hive-site.xml
hive-site.xml
<configuration> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://localhost/metastore?createDatabaseIfNotExist=true</value> <description>metadata is stored in a MySQL server</description> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> <description>MySQL JDBC driver class</description> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>hiveuser</value> <description>user name for connecting to mysql server</description> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>hivepassword</value> <description>password for connecting to mysql server</description> </property> </configuration>
Step7) Create table "gtupapers" in Hive.
From the above screenshot, we can observe the following
In the next step, we are going to check whether it is stored in MySql or not
Step 8) Entering into MySql shell mode
From the above screenshot, we can observe the following
Step 9) Checking whether created table is presenting MySQL or Not
By entering select * from TBLS, it is going to display the tables that we created in Hive shell mode
From the above screenshot we can observe following things:
In this tutorial, you will learn- What is Hive? Hive Architecture Different modes of Hive What is...
In this tutorial, you will learn- Join queries Different type of joins Sub queries Embedding custom...
Table Operations such as Creation, Altering, and Dropping tables in Hive can be observed in this...
Prior to Apache Hive installation we require dedicated Hadoop installation, up and running with...
Hive as an ETL and data warehousing tool on top of Hadoop ecosystem provides functionalities like...
Tables, Partitions, and Buckets are the parts of Hive data modeling. What is Partitions? Hive...