• Call us: +91 9501707741
  • tutorialzdiary@gmail.com


HADOOP Tutorials

Chapter 1 : Introduction
Chapter 2 : What is Hadoop ?
Chapter 3 : HDFS
Chapter 4: HDFS Security
Chapter 5 : Sqoop
Chapter 6 : Apache Pig

HADOOP Hands on

Hadoop 1 : Ingesting Data into Hadoop Through Sqoop
Hadoop 2 : Basics of Apache Hive
Hadoop 2.1 : Apache Hive Tables
Hadoop 3: Basics of Apache Pig
Hadoop 4 : Basics of Apache HBase

HADOOP Interview Questions and Answers

Part 1 : Big Data Basics
Part 2 : MapReduce
Part 3 : Mapreduce II
Part 4 : Hive I
Part 5 : Hive II
Part 6 : Hbase I

HADOOP Training

BigData and Hadoop Training Course

Hadoop 4 : Basics of Apache HBase

HBase is a database built on top of the HDFS. HBase provides fast lookups for larger tables. The goal of the HBase project is to host very large tables — billions of rows multiplied by millions of columns — on clusters built with commodity hardware. HBase is an open-source, distributed, versioned, column-oriented storage.

Hbase consists of :

Table is a collection of rows.
Row is a collection of column families.
Column family is a collection of columns.

Example schema of the table in HBase.

Hbase Table Structure

Hbase Table Structure

Features of HBase :

  • Integrates with Hadoop as source and destination.
  • Available Java API .
  • Hbase is Scalable.
  • Supports automatic failure.

 Use HBase where  :
Your Application requires to have random, real-time read/write access to Big Data.

Let’s get started :-

  1. To use Hbase : Go to  Shell/Terminal. Type command ” hbase shell “.

Something like this will open :-

Hbase Shell

Hbase Shell

2. To create table in Hbase use command : create ‘<table name>’ ,'<column family name>’ .
Here we have created the table with the name “employ” which has two column families (i) personal (ii) dep_details.
We use command “list” to show all tables in Hbase is equal to SQL “show tables” .

Remember : Unlike JAVA and SQL you don’t need semicolon “;” to end command.

create table in Hbase

create a table in Hbase

3. Above command – created an empty table in Hbase. Now populate your tables with data USING command “put“. Just for reference you take command PUT similar to SQL command INSERT. In Hbase while inserting your data specify “ROW ID” – is unique value similar to PRIMARY KEY in SQL followed by “column family : column name ” and its “VALUE” i.e DATA.

put ‘ < ROW ID > ‘ , ‘ < COLUMN FAMILY NAME : COLUMN NAME >’ , ‘ < VALUE >’

raw input data for table

raw input data for the table

Putting your data into Hbase table

Putting your data into Hbase table

4.  To count the number of records in your table use command count i.e : count ‘ < table name > ‘. 

Number of records in your table

Number of records in your table

but now you want to see  whole data of your table use the command “scan” – scan ‘ < table name > ‘.

coomand to check data in table

Command to check data in the table

Entered something wrong data in your table, let’s erase it. To remove something from Hbase table use command “DELETE” – delete ‘ <table name>’, ‘<column family : column name>’ . Here we have employ data and employee name “lily” whose salary has been entered  incorrectly.

Delete data from Hbase

Delete data from Hbase

We have one more similar command like SQL “truncate”, which will keep your table structure but delete all data. Use command  truncate ‘<table name>’.

Delete all data from the table

Delete all data from the table

Don’t need even this table anymore, then remove it. First disable table using command – disable ‘<table name >’ and then drop your table using command – drop ‘<table name>’.

Drop the table in Hbase

Drop the table in Hbase

Happy Learning  Apache Hbase !!



Leave a reply

Your email address will not be published. Required fields are marked *

Training Enquiry