Support Questions

Find answers, ask questions, and share your expertise

Sqoop-HDFS-HBASE

Explorer

I have sqooped the data from postgres to HDFS which generated a part-m-00000.deflate . Now i want to create a hbase table and load this data into the Hbase table. can someone help me on this please.

3 REPLIES 3

Rising Star

@Adithya Sajjanam

you can execute below command from unix terminal replacing delimiter and table structure with the actual data.

/usr/bin/hbase org.apache.hadoop.hbase.mapreduce.ImportTsv-Dimporttsv.separator=','-Dimporttsv.columns='HBASE_ROW_KEY,cf1:col1,cf1:col2,cf1:col3,cf1:col4' <tablename> user/part-m-00000.deflate

Alternatively ,You can also directly sqoop the data to HBASE .

sqoop import 
    --connect jdbc:mysql://localhost/serviceorderdb 
    --username root -P 
    --table customercontactinfo 
  --columns "customernum,contactinfo" 
    --hbase-table customercontactinfo 
  --column-family ContactInfo 
    --hbase-row-key customernum -m 1

Explorer

Hi @rtrivedi i tried using the command from shell script it throws me the following error.

Error: Could not find or load main class course_code:course_code,course_code:score

please help

Thanks

Rising Star

@Adithya Sajjanam

Can you send the complete command you executed with error message.