"Apache Hive is an open source data processing tool on Hadoop that enables programmers to analyze large datasets stored in HDFS by using SQL like queries."
"Basic Hive is not sufficient if you want to work on Real-world projects.”Make yourself prepared to work on Real time Big data and Hive projects by learning Advance Hive from this course. In this course you will get end-to-end knowledge of Basic + This course is very rare of its kind and includes even very thin details of Hive which are not available anywhere online.
What in nutshell is included in the course ?
"Apache Hive is an open source data processing tool on Hadoop that enables programmers to analyze large datasets stored in HDFS by using SQL like queries."
"Basic Hive is not sufficient if you want to work on Real-world projects.”Make yourself prepared to work on Real time Big data and Hive projects by learning Advance Hive from this course. In this course you will get end-to-end knowledge of Basic + This course is very rare of its kind and includes even very thin details of Hive which are not available anywhere online.
What in nutshell is included in the course ?
Learn the Basic Hive concepts to kickstart your learning including :
Introduction to Hive tool, Architecture, Installation, SQL vs Hive.
Create Databases & Tables and insert data into them.
Internal vs External tables concept in Hive
Joins, Views, Mathematical functions, Date functions, String functions, Conditional statements etc.
Learn the ADVANCE Hive concepts that are actively used in Real-world projects like:
Variables in Hive
Partitioning and Bucketing in Hive
Explode & Lateral view in Hive
Table properties of Hive
Custom Input Formatter
Map and Bucketed Joins
Advance functions in Hive
ACID features of Hive
User defined functions (UDFs) in Hive
Compression techniques in Hive
Configuration settings of Hive
Working with Multiple tables in Hive
Loading Unstructured data in Hive
and many more...
This course is a complete package explaining even rarely used commands and concepts in Hive. After completing this course you won't find any topic left.
Apart from this I have included one more section which is Use cases asked in Interviews. Usually students can answer the direct questions asked by Interviewers but got stuck on Use cases . For that I have explained the frequently asked Use cases with their proper practical working in Hive.
This video gives a brief description of Hive.
This videos explains the reason of Why Hive was developed.
Since syntax of Hive is similar to that of SQL .This video will explain the similarities and difference between SQL and Hive
This videos explains the general working of Hive. Hive can process and stores structural data only. It does this by linking the metadata of it's table to the file in HDFS.
Important Note* - Hive is not a database . After loading data into hive table, Our HDFS file will not move to Hive rather after loading now Hive will sees that file in a tabular way
Architecture of Hive-
Hive has these components in its architecture:
This PDF contains a step by step procedure to install Hadoop and Hive along with other resources like Java,Virtual Box and Ubuntu
Hive is not a database but to store the metadata of its tables Hive uses Databases .By default Hive provides Derby database but in real time projects we use strong databases like MYSQL.
This videos explains How to create database in various ways using different options.
Since Hive stores the data into structural format we create Tables. In this lecture we will create tables in Hive .Tables in Hive can be created in many ways with a lot of options.
After table creation we have to load the data in those Hive tables. Note that loading does not mean transferring data into Hive because Hive is not a database,Rather it will just link the metadata of Hive table to corresponding HDFS file.
Part 2
Since Hive stores the data into structural format we create Tables. In this lecture we will create tables in Hive .Tables in Hive can be created in many ways with a lot of options.
After table creation we have to load the data in those Hive tables. Note that loading does not mean transferring data into Hive because Hive is not a database,Rather it will just link the metadata of Hive table to corresponding HDFS file.
There are two types of tables we can create in Hive i.e. Internal or Managed and External tables.
The main difference between these two tables appears while we drop a table. In case of dropping of Internal tables both the schema as well as data is lost since Hive is responsible for both schema and data but in case of dropping External table only the schema or metadata of table is lost, the data is not lost and will be present in the same HDFS location. The data can still be accessed by other applications.
Insert statement is used to load the data from one Hive table to another Hive table.
Multi insert statement is used to load data from a 1 table into multiple tables.
Once created a Hive table it's schema can be changed according to new requirements. This lecture explains how a Hive table's schema can be changed in various ways.
Order by - In Hive, ORDER BY guarantees total ordering of data, and for that it has to be passed on to a single reducer.
Sort by- Sort by does not ensure full ordering of data rather it ensures ordering of data within a reducer.
Distribute by- Distribute by ensures that all rows with the same Distribute By columns will go to the same reducer.
Cluster by- Cluster By is a shortcut for both Distribute By and Sort By. First Distribute by ensures all same column values in single reducer and then sorts those rows inside the reducer.
Lecture also explains
difference between order by and sort by
order by with limit clause
behaviour order by command in strict and non strict mode
Hive provides us with these Date and Mathematical functions.
This video explains various string functions in Hive.
These string functions are widely used in Hive.
Following are the list of conditional statements used in Hive.
| if(boolean testCondition, T valueTrue, T valueFalseOrNull) | Returns valueTrue when testCondition is true, returns valueFalseOrNull otherwise. |
| isnull( a ) | Returns true if a is NULL and false otherwise. |
| isnotnull ( a ) | Returns true if a is not NULL and false otherwise. |
| nvl(T value, T default_value) | Returns default value if value is null else returns value (as of HIve 0.11). |
| COALESCE(T v1, T v2, ...) | Returns the first v that is not NULL, or NULL if all v's are NULL. |
| CASE a WHEN b THEN c [WHEN d THEN e]* [ELSE f] END | When a = b, returns c; when a = d, returns e; else returns f. |
| CASE WHEN a THEN b [WHEN c THEN d]* [ELSE e] END | When a = true, returns b; when c = true, returns d; else returns e. |
These are concepts of Advance Hive. Explode function and lateral view
explode() takes in an array as an input and outputs the elements of the array as separate rows.
Lateral view is used to select other table columns with exploded columns.
This is an advance function in Hivewhere if any substring of A matches with B then it evaluates to true.
Example: ‘Super’ RLIKE ‘Su’ –> True
Advance Hive functions. They come under hive analytical functions.
In Rank() function equal ranks are given same rank value
In dense_rank() function equal ranks are given same rank value but there will be no gaps as are in rank() function
row_number() function will not give equal rank value for same ranks .
The lecture also contains difference between rank() and dense_rank().
Partitioning is a data organizing technique in Hive. It is a way of organizing tables into smaller partitions based on values of columns in table.
Partitioning can be done in two ways.
Static Partitioning: In static partitioning the partition column is hardcoded and we have to manually mention the partition name while loading data into it.
Dynamic Partitioning: In dynamic partitioning Hive automatically decides the partitions based on the values of partitioned column .
This lecture covers:
Dynamic Partitioning in Hive: In dynamic partitioning Hive automatically decides the partitions based on the values of partitioned column.
This lecture covers:
This is an Advance Hive concept usually asked in Interviews.
Partitioned tables schema can also be altered like changing partition location, adding new partition, drop a partition.
MSCK repair table command in Hive is used to update the metadata of table in case of manually adding a partition in HDFS location
Bucketing is another data organizing technique in Hive. While partitioning is organizing table into a number of directories, bucketing is organizing table in files.
This video explains:
Tablesampling is Advance Hive concept and a provision of bucketing.
Video explains:
Advance Hive concept:
With No_drop and offline command we can prevent a Hive table or partition from being queried or dropped.
Joins in Hive behave as same as in SQL i.e joining 2 tables based on a joining condition.
This video explains how to join 2 tables in Hive.
These are types of joins supported by Hive : Inner join, Left outer join, Right outer join and Full outer join
Advance Hive concept
We can also join 3 tables in a single query in Hive.
This video contains:
How to join 3 tables in Hive
Memory organisation while joining tables.
Map join is a Advance Hive join .
The logic behind Map join is that the join operation is executed totally on Map side .No reducer is used in Map joins.
These video contains:
Views in Hive also serve the same purpose as in SQL.A View on a table can be thought of as an image of that table.
This video contains
What are views in Hive
Advantages of Views in Hive.
Where to use Views in Hive
Indexing in Hive is a optimization technique to reduce the throughput time of query. There is a separate index table created in which indexes of all indexed columns are stored.
In this lecture we will learn:
As we know there are 2 types of indexes in Hive. The question is Can we create both Indexes on same table at same time. Answer is yes. We can create multiple Indexes on same table. More iis explained in the videos
Indexing should be use blindly everywhere in Hive since Indexing can be disadvantageous also in some cases. This video explains When and When not to use Indexing in Hive.
UDF (User defined functions) are backbone of any Real time Hive project because in Live projects requirements are complicated and can not be met with Built-in functions. WIth UDF we can write our own functions according to the requirement and then use those functions in Hive queries.
This video explains how to create a UDF function in Java and how to use it in Hive.
Advance Hive table property:
This property is used in Hive tables while loading data into them. We can skip some rows from file to be loaded into our Hive table
Immutable property is also used in Real time projects of Hive. This lecture shows behaviour of Insert statement with into and overwrite options when immutable property is set to true.
Purge property is used In Hive when we don't our data doing to trash. When the purge property is set to true the data will be completely gone and cannot be recovered.
This Advance Hive lecture contains:
Advance Hive table property:
By default nothing is null between delimiters in a file for Hive. This property tells Hive what value should be considered as NULL .
ACID properties in Hive - Advance Hive concept
Advance Hive table property
There are different types of file formats supported by Hive. Hive can store the data in RC ,Parquet ,Textfile formats. Out of these 1 is ORC file format. This video explains the table properties of that Hive table which stores data in ORC format.
This lecture includes the first set of configurations and settings that can made in Hive
This lecture includes the second set of configurations and settings that can made in Hive
Hive creates its own small files during and after query execution. By setting some Hive properties we can tell Hive to automatically Merge files. It is an optimization technique and concept of Advance Hive
Parallelism in Hive means executing independent portions of a query parallely . This is done to reduce the execution time.
**Note: Parallelism should be used wisely, it may lead to a deadlock situation.
This video contains:
;Advance Hive concept
Same like we can execute Unix and HDFS commands in Hive shell, Hive queries can also be executed in Bash shell. We use hive -e option to run individual hive commands and hive -f option to run Hive scripts from Bash shell.
Advance Hive:
We can also run Unix and Hadoop commands from our Hive shell. This is a good approach to run Unix and Hadoop commands from Hive shell rather an opening a new JVM instance.
Advance Hive:
Hive variables are widely used in Real time Live Hive Projects. Variables in Hive behave as same in any other programming language. We can declare variables in two ways hiveconf and hivevar
Advance Hive concept:
We can also pass value to Hive variables from Bash shell. These Hive variables can be passes to a query or to a Hive script.
Advance Hive concept
This Hive lecture explains how to a variable gets it's value from other variable and to do this which Hive property should be set to true.
Custom input format in hive - Advance Hive
Hive works in these following 3 modes:
This Advance Hive lecture explains:
Hiverc is a configuration file in Hive. It runs when we launch our hive shell. Hiverc file is used to
Archiving in Hive is a rarely known feature of Hive and is also rarely used. By archiving we bundle less frequently used files in Hive for saving memory.
Hive Use case 1:
This Use Case is about How to load Semi-structured data in Hive. Usually we load structured data in Hive tables but we can also load semi-structured data like XML in our Hive tables.
This videos explains:
Hive Use case 1
Explained further.
Hive Use case 2:
This Hive Use case is usually asked in Interviews . This explains How to capture changed data in Hive or How we deal with Hive tables that are being updated frequently.
Hive Use case 2
This Hive Use case is usually asked in Interviews . This explains How to capture changed data in Hive or How we deal with Hive tables that are being updated frequently.
Hive Use case 3
In purely Hive based Interviews this Use case is very common. As in Big data training we all learn Word count by using MapReduce Program. The same Word count can be achieved by Hive also.
This Lecture will explain How to implement Word count in Hive .
Hive Use case 4:
This Use case explains How we deal with that situation when there are multiple Hive tables built on same file. We can create any number of Hive tables on 1 file. The Question is how those different Hive tables having different number of columns behaves since the file's data is same for every table.
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.