SlideShare a Scribd company logo
1 of 19
HIVE Introduction 
•A cost effective data warehouse style solution 
for Hadoop 
•Hadoop base 
–Cost effective ,very large scale and flexible data 
management 
•Familiar to huge exiting base of SQL users 
•Easy to learn 
•No need to write Java data access programs
HIVE Introduction 
•SQL like ad-hoc query , aggregation and analysis 
of huge volumes of data 
–SQL like query language called HiveQL 
•Hadoop base for cost effective data 
management 
–Map/reduce for execution 
–Hadoop distributed file system (HDFS) for storage 
•JDBC/ODBC access 
•Extensible
HIVE Introduction 
•Schema on read Vs schema on write improves 
flexibility 
–Traditional databases enforces schema at load time 
–Schema on write 
–Hive enforces schema when query is issued 
–Schema on read 
•Not designed for online transaction processing
Scenario
Hive architecture 
•Components 
–Driver 
–Metastore 
–Interfaces 
–Thrift server
Data model – Database and table 
•Location in HDFS 
–Hive data stored in HDFS under user 
/hive/warehouse (default) 
•Database 
–Namespace the group together related table and 
other data units 
–Each database is a parent folder in the Hive specific 
directory in HDFS
Data model – Database and table 
•TABLE 
–A collection of related columns 
–Can be filtered , projected , joined etc 
–Columns types 
–Primitives 
•TINYINT,INT,BIGINT,BOOLEAN,DOUBLE,STRING 
–Array of primitives 
–Map of primitives (key value pairs) 
–Structure made up of elements of different data types 
•Accessed using dot notation 
•CREATE TABLE complex_data_type ( 
–Fruits Array <string> 
–Pass_list Map<string,String> 
–Car Struct<color:string , Wheel_size :float>);
HiveQL is not SQL 
•Not 100% ANSI-Compliant SQL 
•Join predicates only support equity operator 
•No “inset into” 
–Can’t insert into an exsisting table or data partition 
–Only supports “insert overwrite “so an insert will always 
overwrite the existing data in the whole table or partition 
•No “update “or “delete” 
•No access control language supported 
•Incomplete support for correlated subquery
Hive Benefits 
•Bridges the gap between low-level java 
programming for hadoop and SQL 
•ODBC/JDBC interfaces enable many commercial 
business intelligence and ETL 
•Leverages Hadoop supports partitioning for 
scalability and performance 
•Extensible (UDF,SerDe etc.)
Datatypes in HIVE 
primitive datatypes 
TINYINT 
SMALLINT 
INT 
BIGINT 
BOOLEAN 
FLOAT 
DOUBLE 
STRING
Collection data types 
STRUCT 
struct('John', 'Doe') 
MAP 
map('first', 'John','last', 'Doe') 
ARRAY 
array('John', 'Doe') 
CREATE TABLE employees (name STRING, 
Salary FLOAT, 
subordinates ARRAY<STRING>, 
deductions MAP<STRING, FLOAT>, 
Address STRUCT<street:STRING, city:STRING, state:STRING,
DATABASES in HIVE 
It is a catalog or namespace of tables.Used for avoiding 
table name collisions. 
SYNTAX: 
hive>CREATE DATABASE movies; 
you can see the databases that already exist as follows: 
hive> SHOW DATABASES; 
setting a database as your working database: 
hive> USE movies; 
If not specified, the default database is used.
DATABASES in HIVE 
It is a catalog or namespace of tables.Used for avoiding 
table name collisions. 
SYNTAX: 
hive>CREATE DATABASE movies; 
you can see the databases that already exist as follows: 
hive> SHOW DATABASES; 
setting a database as your working database: 
hive> USE movies; 
If not specified, the default database is used.
Creating Tables 
Table creation SYNTAX: 
hive>CREATE TABLE movies(id INT,name STRING, 
year INT,rating FLOAT,duration FLOAT) 
row format delimited fields terminated by ' 
Showing tables in a database SYNTAX: 
hive>SHOW TABLES; 
Showing details about the table SYNTAX: 
hive>DESCRIBE movies; 
Deleting table SYTAX: 
hive>DROP TABLE movies;
Managed vs External table 
The tables we have created so far are called managed 
table(internal tables) and hive Controls life cycle of Data. 
Managed tables are less convenient for sharing with 
other tools. 
We can define an external table that points to that data, 
but doesn’t take ownership of it. 
SYNTAX: 
CREATE EXTERNAL TABLE movies(......)ROW 
FORMAT DELIMITED FIELDS TERMINATED BY ',' 
LOCATION '/data/movies';
Alter Table 
Table properties can be altered with this, which 
change metadata about the table but not the data itself. 
Renaming: 
ALTER TABLE movies RENAME TO cinemas; 
Adding Columns: 
ALTER TABLE movies ADD COLUMNS (language string); 
Changing column position: 
ALTER TABLE movies 
CHANGE COLUMN name names string AFTER year;
Loading data 
Hive has no row-level insert, update, and delete 
operations, the only way to put data into an table 
is to use one of the “bulk” load operations. 
From hdfs SYNTAX: 
load data inpath '/user/divya/dataset/movie.csv' 
into table movies; 
From local system SYNTAX: 
load data LOCAL inpath '/home/divya/dataset/movie.into table movies;
THANK YOU

More Related Content

What's hot

Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
Simplilearn
 
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Simplilearn
 

What's hot (20)

Big Data technology Landscape
Big Data technology LandscapeBig Data technology Landscape
Big Data technology Landscape
 
Hadoop Ecosystem
Hadoop EcosystemHadoop Ecosystem
Hadoop Ecosystem
 
Hive
HiveHive
Hive
 
Introduction to sqoop
Introduction to sqoopIntroduction to sqoop
Introduction to sqoop
 
Hive
HiveHive
Hive
 
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
 
SQOOP PPT
SQOOP PPTSQOOP PPT
SQOOP PPT
 
Introduction to Hadoop
Introduction to HadoopIntroduction to Hadoop
Introduction to Hadoop
 
Apache HBase™
Apache HBase™Apache HBase™
Apache HBase™
 
Apache Hive
Apache HiveApache Hive
Apache Hive
 
Hive(ppt)
Hive(ppt)Hive(ppt)
Hive(ppt)
 
Hadoop Overview & Architecture
Hadoop Overview & Architecture  Hadoop Overview & Architecture
Hadoop Overview & Architecture
 
Hadoop
HadoopHadoop
Hadoop
 
Apache Sqoop Tutorial | Sqoop: Import & Export Data From MySQL To HDFS | Hado...
Apache Sqoop Tutorial | Sqoop: Import & Export Data From MySQL To HDFS | Hado...Apache Sqoop Tutorial | Sqoop: Import & Export Data From MySQL To HDFS | Hado...
Apache Sqoop Tutorial | Sqoop: Import & Export Data From MySQL To HDFS | Hado...
 
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
 
Big Data & Hadoop Tutorial
Big Data & Hadoop TutorialBig Data & Hadoop Tutorial
Big Data & Hadoop Tutorial
 
Hive(ppt)
Hive(ppt)Hive(ppt)
Hive(ppt)
 
Apache Hive - Introduction
Apache Hive - IntroductionApache Hive - Introduction
Apache Hive - Introduction
 
Hadoop Tutorial For Beginners
Hadoop Tutorial For BeginnersHadoop Tutorial For Beginners
Hadoop Tutorial For Beginners
 
Apache Hive Tutorial
Apache Hive TutorialApache Hive Tutorial
Apache Hive Tutorial
 

Viewers also liked

An intriduction to hive
An intriduction to hiveAn intriduction to hive
An intriduction to hive
Reza Ameri
 
HIVE: Data Warehousing & Analytics on Hadoop
HIVE: Data Warehousing & Analytics on HadoopHIVE: Data Warehousing & Analytics on Hadoop
HIVE: Data Warehousing & Analytics on Hadoop
Zheng Shao
 
Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability |
Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability | Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability |
Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability |
Edureka!
 

Viewers also liked (7)

Hadoop Adminstration with Latest Release (2.0)
Hadoop Adminstration with Latest Release (2.0)Hadoop Adminstration with Latest Release (2.0)
Hadoop Adminstration with Latest Release (2.0)
 
An intriduction to hive
An intriduction to hiveAn intriduction to hive
An intriduction to hive
 
Hive User Meeting August 2009 Facebook
Hive User Meeting August 2009 FacebookHive User Meeting August 2009 Facebook
Hive User Meeting August 2009 Facebook
 
HIVE: Data Warehousing & Analytics on Hadoop
HIVE: Data Warehousing & Analytics on HadoopHIVE: Data Warehousing & Analytics on Hadoop
HIVE: Data Warehousing & Analytics on Hadoop
 
Hive Quick Start Tutorial
Hive Quick Start TutorialHive Quick Start Tutorial
Hive Quick Start Tutorial
 
Integration of Hive and HBase
Integration of Hive and HBaseIntegration of Hive and HBase
Integration of Hive and HBase
 
Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability |
Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability | Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability |
Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability |
 

Similar to Hive Hadoop

Similar to Hive Hadoop (20)

Ten tools for ten big data areas 04_Apache Hive
Ten tools for ten big data areas 04_Apache HiveTen tools for ten big data areas 04_Apache Hive
Ten tools for ten big data areas 04_Apache Hive
 
02 data warehouse applications with hive
02 data warehouse applications with hive02 data warehouse applications with hive
02 data warehouse applications with hive
 
Unit 5-lecture4
Unit 5-lecture4Unit 5-lecture4
Unit 5-lecture4
 
hive_slides_Webinar_Session_1.pptx
hive_slides_Webinar_Session_1.pptxhive_slides_Webinar_Session_1.pptx
hive_slides_Webinar_Session_1.pptx
 
Hive @ Bucharest Java User Group
Hive @ Bucharest Java User GroupHive @ Bucharest Java User Group
Hive @ Bucharest Java User Group
 
Apache Hive, data segmentation and bucketing
Apache Hive, data segmentation and bucketingApache Hive, data segmentation and bucketing
Apache Hive, data segmentation and bucketing
 
Hive Evolution: ApacheCon NA 2010
Hive Evolution:  ApacheCon NA 2010Hive Evolution:  ApacheCon NA 2010
Hive Evolution: ApacheCon NA 2010
 
Apache Hive
Apache HiveApache Hive
Apache Hive
 
ACADGILD:: HADOOP LESSON
ACADGILD:: HADOOP LESSON ACADGILD:: HADOOP LESSON
ACADGILD:: HADOOP LESSON
 
03 hive query language (hql)
03 hive query language (hql)03 hive query language (hql)
03 hive query language (hql)
 
Hadoop intro
Hadoop introHadoop intro
Hadoop intro
 
Hive
HiveHive
Hive
 
מיכאל
מיכאלמיכאל
מיכאל
 
What's New Tajo 0.10 and Its Beyond
What's New Tajo 0.10 and Its BeyondWhat's New Tajo 0.10 and Its Beyond
What's New Tajo 0.10 and Its Beyond
 
Hive big-data meetup
Hive big-data meetupHive big-data meetup
Hive big-data meetup
 
SQL on Hadoop
SQL on HadoopSQL on Hadoop
SQL on Hadoop
 
Hadoop_arunam_ppt
Hadoop_arunam_pptHadoop_arunam_ppt
Hadoop_arunam_ppt
 
6.hive
6.hive6.hive
6.hive
 
An introduction to Apache Hadoop Hive
An introduction to Apache Hadoop HiveAn introduction to Apache Hadoop Hive
An introduction to Apache Hadoop Hive
 
Hive_An Brief Introduction to HIVE_BIGDATAANALYTICS
Hive_An Brief Introduction to HIVE_BIGDATAANALYTICSHive_An Brief Introduction to HIVE_BIGDATAANALYTICS
Hive_An Brief Introduction to HIVE_BIGDATAANALYTICS
 

Recently uploaded

Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
amitlee9823
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
amitlee9823
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
amitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
only4webmaster01
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
amitlee9823
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 

Recently uploaded (20)

Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
hybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptxhybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptx
 

Hive Hadoop

  • 1.
  • 2. HIVE Introduction •A cost effective data warehouse style solution for Hadoop •Hadoop base –Cost effective ,very large scale and flexible data management •Familiar to huge exiting base of SQL users •Easy to learn •No need to write Java data access programs
  • 3. HIVE Introduction •SQL like ad-hoc query , aggregation and analysis of huge volumes of data –SQL like query language called HiveQL •Hadoop base for cost effective data management –Map/reduce for execution –Hadoop distributed file system (HDFS) for storage •JDBC/ODBC access •Extensible
  • 4. HIVE Introduction •Schema on read Vs schema on write improves flexibility –Traditional databases enforces schema at load time –Schema on write –Hive enforces schema when query is issued –Schema on read •Not designed for online transaction processing
  • 6. Hive architecture •Components –Driver –Metastore –Interfaces –Thrift server
  • 7. Data model – Database and table •Location in HDFS –Hive data stored in HDFS under user /hive/warehouse (default) •Database –Namespace the group together related table and other data units –Each database is a parent folder in the Hive specific directory in HDFS
  • 8. Data model – Database and table •TABLE –A collection of related columns –Can be filtered , projected , joined etc –Columns types –Primitives •TINYINT,INT,BIGINT,BOOLEAN,DOUBLE,STRING –Array of primitives –Map of primitives (key value pairs) –Structure made up of elements of different data types •Accessed using dot notation •CREATE TABLE complex_data_type ( –Fruits Array <string> –Pass_list Map<string,String> –Car Struct<color:string , Wheel_size :float>);
  • 9. HiveQL is not SQL •Not 100% ANSI-Compliant SQL •Join predicates only support equity operator •No “inset into” –Can’t insert into an exsisting table or data partition –Only supports “insert overwrite “so an insert will always overwrite the existing data in the whole table or partition •No “update “or “delete” •No access control language supported •Incomplete support for correlated subquery
  • 10. Hive Benefits •Bridges the gap between low-level java programming for hadoop and SQL •ODBC/JDBC interfaces enable many commercial business intelligence and ETL •Leverages Hadoop supports partitioning for scalability and performance •Extensible (UDF,SerDe etc.)
  • 11. Datatypes in HIVE primitive datatypes TINYINT SMALLINT INT BIGINT BOOLEAN FLOAT DOUBLE STRING
  • 12. Collection data types STRUCT struct('John', 'Doe') MAP map('first', 'John','last', 'Doe') ARRAY array('John', 'Doe') CREATE TABLE employees (name STRING, Salary FLOAT, subordinates ARRAY<STRING>, deductions MAP<STRING, FLOAT>, Address STRUCT<street:STRING, city:STRING, state:STRING,
  • 13. DATABASES in HIVE It is a catalog or namespace of tables.Used for avoiding table name collisions. SYNTAX: hive>CREATE DATABASE movies; you can see the databases that already exist as follows: hive> SHOW DATABASES; setting a database as your working database: hive> USE movies; If not specified, the default database is used.
  • 14. DATABASES in HIVE It is a catalog or namespace of tables.Used for avoiding table name collisions. SYNTAX: hive>CREATE DATABASE movies; you can see the databases that already exist as follows: hive> SHOW DATABASES; setting a database as your working database: hive> USE movies; If not specified, the default database is used.
  • 15. Creating Tables Table creation SYNTAX: hive>CREATE TABLE movies(id INT,name STRING, year INT,rating FLOAT,duration FLOAT) row format delimited fields terminated by ' Showing tables in a database SYNTAX: hive>SHOW TABLES; Showing details about the table SYNTAX: hive>DESCRIBE movies; Deleting table SYTAX: hive>DROP TABLE movies;
  • 16. Managed vs External table The tables we have created so far are called managed table(internal tables) and hive Controls life cycle of Data. Managed tables are less convenient for sharing with other tools. We can define an external table that points to that data, but doesn’t take ownership of it. SYNTAX: CREATE EXTERNAL TABLE movies(......)ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LOCATION '/data/movies';
  • 17. Alter Table Table properties can be altered with this, which change metadata about the table but not the data itself. Renaming: ALTER TABLE movies RENAME TO cinemas; Adding Columns: ALTER TABLE movies ADD COLUMNS (language string); Changing column position: ALTER TABLE movies CHANGE COLUMN name names string AFTER year;
  • 18. Loading data Hive has no row-level insert, update, and delete operations, the only way to put data into an table is to use one of the “bulk” load operations. From hdfs SYNTAX: load data inpath '/user/divya/dataset/movie.csv' into table movies; From local system SYNTAX: load data LOCAL inpath '/home/divya/dataset/movie.into table movies;