Setup hive and test queries
Upcoming SlideShare
Loading in...5
×
 

Setup hive and test queries

on

  • 527 views

This is basic tutorial to setup hive in rapid way and quickly test the hive shell with same statement.

This is basic tutorial to setup hive in rapid way and quickly test the hive shell with same statement.

Statistics

Views

Total Views
527
Views on SlideShare
526
Embed Views
1

Actions

Likes
0
Downloads
14
Comments
0

1 Embed 1

http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Setup hive and test queries Setup hive and test queries Presentation Transcript

    • Setup Hive and Collect the Honey By Kannan Kalidasan
    • Hive Introduction Hive is a data warehousing infrastructure based on Hadoop. Hive is designed to enable easy data summarization, ad-hoc querying and analysis of large volumes of data. It provides a simple query language called Hive QL, which is based on SQL and which enables users familiar with SQL to do ad-hoc querying, summarization and data analysis easily. I recommended To learn Programming Hive – Allan Gates book Believe me any Developers having intermediate knowledge on any one of the Database can able to pick up this easily , quickly and expertise it. When i say intermediate knowledge on Database , i am referring like an individuals has knowledge on Table Creation,Select queries and different clauses,Join Queries, DML Operations,Basic Database creation script knowledge, Indexes and Partitions. Thats it . This should be sufficient for anyone to understand most of the topics in HIVE. Hive has its own features and Data Model Approach which you will come to know when you read it . Then Your brain will start comparing your left and right eyes to know which is best :)
    • Hive Installation 1. Download the stable version of tarbal. http://mirror.reverse.net/pub/apache/hive/stable/ hive-0.11.0.tar.gz Release notes link http://hive.apache.org/releases.html
    • Hive Installation ... 2.Copy the downloaded package to /usr/local kannan@kannandreams:/usr/local$ ls -ltr total 192652 -rw-r–r– 1 root root 74945460 Dec 5 00:59 hive-0.11.0.tar.gz kannan@kannandreams:/usr/local$ 3. unzip and change the owner sudo tar xzf hive-0.11.0.tar.gz sudo mv hive-0.11.0 hive sudo chown -R hduser:hadoop hive chown command change the owner of the directory hive from root to hadoop user hduser.
    • Hive Installation ... 4.Login to Hadoop user hduser and set the environment variables. kannan@kannandreams:/usr/local$ su – hduser Password: hduser@kannandreams:~$ vi .bashrc Add the below two lines in ~/.bashrc file and save it. #Hive env variables export HIVE_HOME=”/usr/local/hive” export PATH=$PATH:$HIVE_HOME/bin hduser@kannandreams:~$ . .bashrc ( source the file to reflect the env. values)
    • Note to Remember Hadoop services should be running to work in Hive Start the Hadoop services with the command start-all.sh
    • Hive Shell hduser@kannandreams:~$ cd $HIVE_HOME hduser@kannandreams:/usr/local/hive$ hive Logging initialized using configuration in jar:file:/usr/local/hive/lib/hive-common0.11.0.jar!/hive-log4j.properties Hive history file= /tmp/hduser/hive_job_log_hduser_6282@kannandreams_201312050123_1791 376162.txt hive>
    • Hive Shell ... Test by creating a sample table and show tables statement – list the tables available in database. hive> show tables; OK Time taken: 6.84 seconds hive> create table test (Id INT); OK Time taken: 0.605 seconds hive> show tables; OK test Time taken: 0.1 seconds, Fetched: 1 row(s) hive>quit;
    • Hive Directory If you notice in HDFS Directory, Hive create the below directory by default based on configuration XML file. I didn’t mentioned in detail about the conf. xml file. drwxr-xr-x – hduser supergroup 0 2013-12-05 01:33 /user/hive drwxr-xr-x – hduser supergroup 0 2013-12-05 01:39 /user/hive/warehouse drwxr-xr-x – hduser supergroup 0 2013-12-05 01:39 /user/hive/warehouse/test
    • Thank You !!! Now we got the new job “apiarist” :) mail : kannanpoem1984@gmail.com @kannanpoem on twitter Blog: http://kannandreams.wordpress.com/about/ FB Community: www.facebook.com/groups/huge360/ HUGE - Hadoop User Group & Enthusiasts Huge , Yes Its All about "BIG" Data This has been created to build a group to get expertise and experts in Hadoop and Big Data .