Reply
Explorer
Posts: 14
Registered: ‎10-25-2016
Accepted Solution

Import / Load data from CSV to Hbase

i am new in hadoop developer, now i try to research with Hbase table.

i want to try to load data from my CSV file. I have more than 10 million data from my CSV file. so i want to populate it to the Hbase table.

but i do not know how to do it. Anybody can help me ? 

what is step by step to populate hbase table from my CSV file ? 

thank you very much, i need somebody help ..

Posts: 1,640
Kudos: 314
Solutions: 254
Registered: ‎07-31-2013

Re: Import / Load data from CSV to Hbase

You are looking for the ImportTSV utility offered by HBase, and its
bulk-load option. Read up more at
http://archive.cloudera.com/cdh5/cdh/5/hbase/book.html#_importtsv to learn
how to use the ImportTSV to prepare bulk-loadable output, followed by
http://archive.cloudera.com/cdh5/cdh/5/hbase/book.html#arch.bulk.load.complete
which
shows how to load the prepared output finally into HBase.

There's also a slightly dated example of the process on the Cloudera
Engineering blog which uses a CSV example with the above process:
http://blog.cloudera.com/blog/2013/09/how-to-use-hbase-bulk-loading-and-why/
Explorer
Posts: 14
Registered: ‎10-25-2016

Re: Import / Load data from CSV to Hbase

so i must to download the importtsv again ? or function importtsv had been there since i download and install hbase for my cluster ?

Posts: 1,640
Kudos: 314
Solutions: 254
Registered: ‎07-31-2013

Re: Import / Load data from CSV to Hbase

The ImportTSV utility comes included with your CDH installation.
Explorer
Posts: 14
Registered: ‎10-25-2016

Re: Import / Load data from CSV to Hbase

i try to use command

"hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.columns=HBASE_ROW_KEY,f:count wordcount word_count.csv"

 

and i get an error like this permission denied : user = xxxxx , access = WRITE, inode ="/user":hdfs:supergroup:drwxr-xr-x

 

what must i do ? .. can you help me ?

Explorer
Posts: 14
Registered: ‎10-25-2016

Re: Import / Load data from CSV to Hbase

i have make it !

i can upload csv now thanks a lot for your help !

i appreciate that :D

Explorer
Posts: 14
Registered: ‎10-25-2016

Re: Import / Load data from CSV to Hbase

sorry for bother again..

i have upload it but when i try to upload it second time with same file..

my mapreduce result is success and the output file is exist.

but my database still empty , i don't know why becuase there is no error in the log.

i only change the name of the output folder, only that..

the first time, my output file is " output " and the next i change my output file to "output2",etc

do you know why ? 

i don't know why this happen.. thank you very much

Highlighted
Zie
New Contributor
Posts: 1
Registered: ‎01-08-2018

Re: Import / Load data from CSV to Hbase

Hallo, can you help me?
I have a problem when importing data into hbase table. I've tried to use importtsv, but the problem is the number of columns in my file very much (1000 columns). Do I have to write all the columns or is there another way that can automatically increase the number of columns according to the file?

Thankyou..
Announcements