Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Sqoop-HDFS-HBASE

Sqoop-HDFS-HBASE

New Contributor

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

Re: Sqoop-HDFS-HBASE

Contributor

@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

Re: Sqoop-HDFS-HBASE

New Contributor

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

Highlighted

Re: Sqoop-HDFS-HBASE

Contributor

@Adithya Sajjanam

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